I'm stuck on this problem(2 weeks). Any idea of how to approach it?.
Let L be a list of n different integer numbers, assume that the elements of x of L are in the range [1,750]. Design a linear ordering algorithm to order the elements of L
I already tried with insertion sort. But i'm not sure if my approach is right:
Construct an array of bits. Initialize them to zero.
Read the input, for each value you see set the respective bit in the array to 1.
Scan the array, for each bit set, output the respective value.
Complexity => O(2n) = O(n)