Tuesday, March 27, 2012

binary search

  • Binary Search
Binary search relies on a divide and conquer strategy to find a value within an already-sorted collection
http://algorithms.openmymind.net/search/binarysearch.html



  • Binary search
A binary search algorithm (or binary chop) is a technique for finding a particular value in a linear array, by ruling out half of the data at each step, widely but not exclusively used in computer science.
A binary search finds the median, makes a comparison to determine whether the desired value comes before or after it, and then searches the remaining half in the same manner.
A binary search is an example of a divide and conquer algorithm (more specifically a decrease and conquer algorithm) and a dichotomic search (more at Search algorithm).
http://www.codecodex.com/wiki/Binary_search

  • Binary Search

http://www.youtube.com/watch?v=QJThYHfaZig


  • Binary Search (recursive version)

http://www.youtube.com/watch?v=vjdTaI9DlFo



  • Binary search (iterative version)

http://www.youtube.com/watch?v=fjlEZWu_c9I

No comments:

Post a Comment