On 15 Jan 2007, at 20:56, Jon Harrop wrote: > Anyone got code for the kth smallest element in a list that I can > borrow? I have code for a set that can be limited to a certain size. While you add a potentially very large number of elements, the set will retain the 30 largest elements it has seen up to that point (given that the set was initialized with bound 30). You could modify the code to keep track of the smallest elements instead. Regards, Bruno