From: SpringFlowers AutumnMoon Date: 2007-10-15T00:13:29+09:00 Subject: Re: top 10 last played mp3's Gavin Kistner wrote: > My understanding is that with a directory containing 5,000 MP3s, this > solution: > > Dir['/share/music/**/*.mp3', '/share/music/*.mp3'].sort_by{ |f| > File.atime(f) > }.reverse[0,10] > > will call File.atime exactly 5,000 times and create exactly 5,000 Time > instances. won't it call File.atime(f) (c * n log n) times? n log n is the big O... O(n log n)... and then c is the constant depending on the sort algorithm. -- Posted via http://www.ruby-forum.com/.