4 ms·
Context can be clarified by writing: "Quickselect is a selection algorithm to find the INDEX OF THE kth smallest element in an unordered list. It is closely rel
by dwils098 10y ago
Context can be clarified by writing: "Quickselect is a selection algorithm to find the INDEX OF THE kth smallest element in an unordered list. It is closely related to the quicksort sorting algorithm."
- coder007 10y agoit doesn't return the index, rather the element itself..
- dwils098 10y agoTrue. This is what I meant by confusing, without properly defining the variables at play, in this context, k is the index of the element of the ordered list, and not the kth smallest element. Semantics, I agree, but confusing nonetheless. Or in other words, how do we define k?
- deleted 10y ago[deleted]