CISC 121 Lecture Notes - Lecture 13: Binary Search Algorithm, Linear Search

51 views1 pages
wunch and 39345 others unlocked
CISC 121 Full Course Notes
35
CISC 121 Full Course Notes
Verified Note
35 documents

Document Summary

October 15th, 2018 i=0 found=false while not(found): found=true return found if target== collection[i]: else: i=i+1. Linear search: you ask every single person, walk through all values and find that value, for example using a for loop to go through a list to find that item. Think of finding an item on amazon, this is why we search. Since it is so important we want to use the built in list functions to find these things because for large data sets this will take a long time. Binary search: narrowing the scope, until we find the item.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions