Look at the code for nth_element in your STL library. Richard ----- Original Message ----- From: "None" <[EMAIL PROTECTED]> To: "Algorithm Geeks" <[email protected]> Sent: Friday, October 27, 2006 12:49 AM Subject: [algogeeks] trying to create a function
> > Hello, I've been trying to figure this out but im missing something > > Given an unsorted array A[0...n-1] of different integers, find the > k-th smallest element (with k=0 being the smallest element). For > example, findKth( [ 8 9 5 6 3 11 ] , 0) = 3 and findKth([ 2 6 5 4 13 > 10 ] , 4 ) = 10. > > Complete the following pseudocode for the findKth algorithm. The > algorithm should have similarities to quickSort and to binarySearch & > should call the partition algorithm used by the quickSort method. You > can call the partition without redefining it. Running time should be > in O(n) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. 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-beta.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
