whats the problem ? if no extra memory allowed then can't be done in better then O(nlogn)sorting time & O(1) space else it will take O(N) time & O(N) Space
sorting will change the order but using bitmap or bitarray order will be preserved Thanks Shashank CSE,BIT Mesra -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.