On May 13, 10:06 am, divya <sweetdivya....@gmail.com> wrote: > This problem was asked in google phone interview. We have N element > array with k distinct keys(No relation between k & N given so assume > k<N) > What is the best method to sort this array without using any extra > memory? Please elaborate.
If "extra memory" includes call stack space, then heap sort. Otherwise recursive quick sort. Seems really straightforward, am I missing something? -- 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 algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.