Rapleaf Interview Question
Software Engineer / Developersi think the question was meant to test how good u understand sorting algos . I would have said i will go for bubble sort with only one pass . As we know in every pass a element is placed at it right position here max element would go to last in one pass.
As with merge sort we would have to first divide the list which would any how will take O(lg(n)) and then we look for max .
I don't understand why merge sort and bubble sort is mentioned here, max can be found in O(n) time anyway.
- Messi April 13, 2010