I need to sort this elements in single pass of o(n) timecomplexity
Ex :1 0 2 0 0 3 0 3 2 0 0 1
I need to sort this elements in single pass of o(n) timecomplexity
Ex :1 0 2 0 0 3 0 3 2 0 0 1
Assuming there is an upper bound on the values in the list you can use counting sort. Radix sort is another option.