Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to get nextMove O(N)

Author: Dann Corbit

Date: 16:59:03 07/23/04

Go up one level in this thread


Similar to what I like to do.
Use the linear "select top N" function I posted in the "find min" thread to
collect the top k entries.  (I like k=4 or 5).  Then I use a special function to
sort the top k items using minimal comparisons and exchanges (a tiny fixed
number of operations).
The other N-k entries can remain unsorted, or you  can repeat the process on the
N-k entries if you never get a big fail-high (if you like.)

Expected time: O(n), with top 4 or 5 items in proper sort order.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.