I just bumped on to this question today and was trying for a solution that is better than O(N) but could not come up with one.
Searched through SO but couldn\'t find
What will be the efficiency of algorithm that makes use of partition approach applied during quick-sort as follows?
Randomly select some value (let us call it v) in the list.
Partition the entire list into 2 parts. Left part contains all elements that are less than v. Right part contains all elements that are greater than v.
Repeat the steps 2, 3 until you determine whether the element exists or does not exist.
I am not sure about the complexity of above algorithm, but looks like it will be definitely less than the complexity of quick-sort algorithm: (n log n).