title: Optimal algorithm for returning top k values from an array of length N
body: <p>I have an array of n floats,  and I wish to return the top k
  (in my case n ~ 100, k ~ 10)</p>
  
  <p>Is there a known optimal solution path for this problem?</p>
  
  <p>Could someone provide a C algorithm?</p>
  
  <p>EDIT:  actually there are two problems here:  sorted and unsorted.  I am interested in unsorted,  which should be faster!</p>