Hi Anika,
Can you comment on the complexity of the algorithm?

It appears to be like an O(n^2).

By the way, we are asked for a inplace sort, and this recursive call stores 
the 3 element(a,b,c) in each level.

So, i iterations, and starting value of i is n/3.. so this takes an 
additional O(n) time. If we have additional space, it can done in O(n) time.

The direct moving of elements towards the right takes O(n^2) time and no 
additional space.

@All: please comment on the above explanation.

(I couldn't find the link or source for the IN/OUT Shuffle card shuffle 
problems, hence looked at your code )
plz provide an weblink of the card shuffle or memory efficient rearrangement 
problem.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/juVr-bx5fVoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to