News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Binary Search Algorithm

Started by UlliN, January 17, 2007, 08:26:23 AM

Previous topic - Next topic

UlliN

Hello,

unlike Lib BinSearch algo, which provides a linear search in binary data, here's a "real" binary search algo "SearchAll" using sorted tables. Don't be bothered by the name, it's inspired by the homonymous COBOL-Command, which does the same ;-).
If the table contains duplicate elements, the returned index(if found) is any valid. There's another modificated algo SearchAll1 providing the lowest index. An appropriate string comparison algo is added and can also be used as callback function by C-bsearch(stdlib.h).
As always improvement would be appreciated.

Regards
Ulli




[attachment deleted by admin]