Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FAQ updated with a binary search algorithm.
#1
A binary search will search a value in an array in log(n) time if the array is sorted.

In this case it works for arrays sorted from least value (in the ath value) to greatest value (in the bth value, where b > a)

http://faq.qbasicnews.com/?blast=BinarySearch

There is also a link to a nice site that explains it in detail.

In time there will be more code pieces added that deal with data manipulation.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)