details of finding 2nd smallest element in unsorted array
<p>Let me make things clear:
I want to know more about the implementation of the "best" ALGORITHM how to find 2nd smallest element in array, which is described here:</p>

<h2><a href="http://stackoverflow.com/questions/3715935/algorithm-find-index-of-2nd-smallest-element-from-an-unknown-array">Algorithm: Find index of 2nd smallest element from an unknown array</a></h2>

<p>First, I am completely clear about the ALGORITHM how to find 2nd smallest element in array. 
The best solution is O(n+lg(n)-2) which can be achieved by first obtaining the smallest element S and then searching the smallest element of S's competitors. Read here:
<a href="http://stackoverflow.com/questions/3715935/algorithm-find-index-of-2nd-smallest-element-from-an-unknown-array">Algorithm: Find index of 2nd smallest element from an unknown array</a></p>

<p>What I cannot understand is how to implement it. </p>

<p>Especially, after finding the smallest element, how to track back those competitors of the smallest element such that I can find 2nd smallest element in those competitors?</p>

<hr>

<h2>NO NEED TO SORT. Quicksort is O(nlg(n)) which is worse than  O(n+lg(n)-2).</h2>

<p>There have been too many people talking about the best solution while nobody actually gave an implementation. Besides, I found the best solution is just theoretical best. It is very hard to implement it following that "best" solution.</p>
