CP104 Study Guide - Fall 2018, Comprehensive Midterm Notes - Monty Python, Test Cricket, Computer Memory

199 views6 pages
5 Nov 2018
School
Course
Professor
hayjayshay and 38575 others unlocked
CP104 Full Course Notes
2
CP104 Full Course Notes
Verified Note
2 documents

Document Summary

Starting at the beginning of the list, look at each element one by one in the list and compare if to the number you are trying to find. Stop when you have found the matching number or have reached the end of the list. This is called a linear search: assuming the elements of the list are in order , split the list in two. If the number you are looking for matches the number in the middle, stop/ if the middle is greater than the number, repeat in the left half of the list. If the middle is less than the number, repeat in the right half of the list/ stop when you have found the matching number or when you can no longer split the list in half. This is called a binary search. (we will see more of both of these algorithms later!)

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