Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I create a search file for text?
#2
Binary search of an array in alpha order call it arr$()

Mark the first item low = 1 mark the last item high = number of items

recalcMiddle:

if low > high then the item is not found in arr$() and you are done with unsuccessful search.

then middle = int(low + high)/2

now if the arr$(middle) > search item then move high to middle - 1 goto recalcMiddle

now if arr$(middle) < search item then low = middle + 1 goto recalcMiddle

now if arr$(middle) = search item then you've found it and are done!

You play the game, guess my number from 1 to 100, in just the same way!
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: How can I create a search file for text? - by bplus - 01-25-2024, 10:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo from png tile, create symmetrical screen image hsiangch_ong 11 979 08-23-2025, 01:23 AM
Last Post: bplus
  Trying to create a simple menu CMR 8 1,240 06-18-2025, 06:59 PM
Last Post: CookieOscar
  IDE search option eoredson 1 542 05-29-2024, 10:15 AM
Last Post: hsiangch_ong
  Create a new character? PhilOfPerth 12 2,179 01-25-2023, 08:07 PM
Last Post: bplus
Question Formatting Text File Output NasaCow 7 1,697 12-08-2022, 11:50 PM
Last Post: NasaCow

Forum Jump:


Users browsing this thread: 1 Guest(s)