is it possible to do without any extra space...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
I think the first 3 methods of the total 4 specified at
http://www.rawkam.com/?p=168
will be applicable for sorting arrays with 0,1 2
On Mon, Aug 23, 2010 at 11:07 AM, Jameel Mohamed
jameel.moha...@gmail.comwrote:
Use counting sort. time complexity is O(n)
On Aug 22, 1:11 pm, AlgoBoy
yes we can
a possible solution what i can think is
treat 12 (same entity )
and 0 as other so in first pass we will short array which will have (all
zeros first , then 12 in some random order )
take index number of zero then in second pass short for 1 2
still O(n) but takes 2 pass
On Mon, Aug
Refer Dutch National Flag Algorithm
On Mon, Aug 23, 2010 at 12:10 PM, Manjunath Manohar
manjunath.n...@gmail.com wrote:
is it possible to do without any extra space...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
Yes, it is possible in one pass without extra memory, I think this is a CLRS
exercise problem.
It is possible in one pass without using extra memory.
Keep the 0's at left and 2's at right and scan the middle portion from left
to right and if you see 0 keep at left side and if you see 2 keep it
@sathiah..i can get u ..but dont seem to understand the part where in we
must keep track of the 1's...can u pls post the code..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To
Use counting sort. time complexity is O(n)
On Aug 22, 1:11 pm, AlgoBoy manjunath.n...@gmail.com wrote:
An algorithm to sort an array of 0's,1's,2's in a single pass...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,