Presentation is loading. Please wait.

Presentation is loading. Please wait.

Binary Search Counting

Similar presentations


Presentation on theme: "Binary Search Counting"— Presentation transcript:

1 Binary Search Counting
counting "# looks" in a binary search

2 linear search A list of 1000 items, searching for one value, how many items might you have to look at to see if it is what you are looking for? # Looks:

3 binary search A list of 1000 items, searching for one value, how many items might you have to look at to see if it is what you are looking for? # Looks: - lets figure it out

4 binary search A list of 1=20 item # Looks: A list of 2=21 items # Looks: A list of 4=22 items # Looks: A list of 8=23 items # Looks: A list of 16=24 items # Looks: A list of 32=25 items # Looks: A list of 2n items # Looks:

5 binary search A list of 1000 (about 1024 = 210) items, searching for one value, how many items might you have to look at to see if it is what you are looking for? # Looks: -


Download ppt "Binary Search Counting"

Similar presentations


Ads by Google