* Algorithm : 1)Conside original array a[] 2)Construct a sorted list with the array elements(O(nlogn)) 3)Traverse across all elements of the original array 'a' and find it's position(right occurence) in the sorted list using binary search. -position in the sorted list returns the number of elements in the less than the current element on right side. -after remove the current element from the sorted list. PS: list is preferred datastructure because there are so many insertion and deletion operations.
check this link : http://rajeevprasanna.blogspot.com/2011/07/count-number-of-min-elements-on-right.html * On Tue, Jul 26, 2011 at 11:08 AM, ankit sambyal <ankitsamb...@gmail.com>wrote: > @vivin : Your algo seems to be wrong. Plz take an example and > explain. I may hv misunderstood u .. > > -- > 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. > > -- Thank You Rajeev Kumar -- 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.