Comments on: Programming Interview Questions 10: Kth Largest Element in Array /2011/10/27/programming-interview-questions-10-kth-largest-element-in-array/?utm_source=rss&utm_medium=rss&utm_campaign=programming-interview-questions-10-kth-largest-element-in-array Information Retrieval and Machine Learning Mon, 23 Jan 2012 19:14:24 +0000 hourly 1 http://wordpress.org/?v=3.3 By: Arden /2011/10/27/programming-interview-questions-10-kth-largest-element-in-array/#comment-1567 Arden Sun, 22 Jan 2012 22:29:32 +0000 /?p=684#comment-1567 Thanks, glad that you liked it. And I think we mean the same thing by saying "kth smallest" and "kth largest". It's basically the kth element in the sorted order. Thanks, glad that you liked it. And I think we mean the same thing by saying “kth smallest” and “kth largest”. It’s basically the kth element in the sorted order.

]]>
By: Alex /2011/10/27/programming-interview-questions-10-kth-largest-element-in-array/#comment-1566 Alex Sun, 22 Jan 2012 22:25:23 +0000 /?p=684#comment-1566 Hey Arden, Thank you for such a detailed explanation! I do have a question - doesn't the first example, kthLargest1, find the kth smallest element in the array? Hey Arden,

Thank you for such a detailed explanation! I do have a question – doesn’t the first example, kthLargest1, find the kth smallest element in the array?

]]>
By: Arden /2011/10/27/programming-interview-questions-10-kth-largest-element-in-array/#comment-728 Arden Sat, 10 Dec 2011 20:09:05 +0000 /?p=684#comment-728 Yes you're right. The problem definition should be kth element in sorted order, not kth largest element. Updated the problem definition. Thanks a lot for the comment.. Yes you’re right. The problem definition should be kth element in sorted order, not kth largest element. Updated the problem definition. Thanks a lot for the comment..

]]>
By: hayro /2011/10/27/programming-interview-questions-10-kth-largest-element-in-array/#comment-723 hayro Sat, 10 Dec 2011 01:50:55 +0000 /?p=684#comment-723 Hi Arden, Did you consider the duplicate values case? It seems when you check the kth element, the duplicate values cause problems because 7th element may not be the 7th largest element if it contains duplicates before it. For example, [44,23,19,19,13,19, 10(pivot) , 4,5,6,8], although 10 is the 7th element it is the 5th largest element. Hi Arden,

Did you consider the duplicate values case? It seems when you check the kth element, the duplicate values cause problems because 7th element may not be the 7th largest element if it contains duplicates before it. For example, [44,23,19,19,13,19, 10(pivot) , 4,5,6,8], although 10 is the 7th element it is the 5th largest element.

]]>
By: Arden /2011/10/27/programming-interview-questions-10-kth-largest-element-in-array/#comment-445 Arden Tue, 08 Nov 2011 17:13:03 +0000 /?p=684#comment-445 Thanks for the notice. They were broken for some reason, now it's fixed. Thanks for the notice. They were broken for some reason, now it’s fixed.

]]>
By: George /2011/10/27/programming-interview-questions-10-kth-largest-element-in-array/#comment-444 George Tue, 08 Nov 2011 08:33:46 +0000 /?p=684#comment-444 What's up with latex script? What’s up with latex script?

]]>