After a couple of posts about my post, I will go back to my point.

You can only binary search a fixed length table. If you create an index
table, the index table is the actual table being searched, not the
original table.

Now, Robert does have mention a neet trick where the fixed table
contains a refference pointer to the actual data to be compared. But,
the pointer table is still a fixed length table. :-)

You just can't binary search a variable length table.

Tony Thigpen

-----Original Message -----
 From: Robert A. Rosenberg
 Sent: 10/24/2013 05:12 PM
At 12:45 -0400 on 10/24/2013, Tony Thigpen wrote about Re: Linear
search vs binary:

All entries will be fixed length. Can't really have variable length and
use a binary search.

That depends. If the table you are sorting is a table of pointers to
the actual data (and is ordered by the compare field), the entries
can be variable length so long as the compare field is fixed length
and is preceded by an entry length field. You use the pointer to find
the compare field of an entry and once you find the correct entry,
you back up to the location of the entry length and can then use the
entry.


Reply via email to