title: Quickselect time complexity explained
body: <p>From <a href="https://en.wikipedia.org/wiki/Quickselect" rel="noreferrer">https://en.wikipedia.org/wiki/Quickselect</a> it says</p>
  
  <p>"However, instead of recursing into both sides, as in quicksort, quickselect only recurses into one side – the side with the element it is searching for. This reduces the average complexity from O(n log n) to O(n), with a worst case of O(n^2)."</p>
  
  <p>I dont understand how reducing to only looking at one side reduces average complexity to O(n)? Wouldnt it be more of O(N/2 log N) which is still O(N log N). And how is the worst case O(n^2)</p>