CS 2114 Lecture Notes - Lecture 24: Binary Search Algorithm, Mobile Suit Gundam
Daniel T. Eisert CS-2114
1
Lecture 24 – Binary Search
April 16, 2018 (Week 13)
Class Business
Project V final submission is due Thursday, April 26. The contribution report
and ethics discussion are both due Sunday, April 29.
Last lab session is Wednesday, April 25.
OpenDSA Homework on Trees is due Monday, April 30.
Efficiency of
Searching
- Major efficiency jump compared to using a loop / using contains.
- in computer science refers to base 2 (Recall ~ ).
- MUST have a sorted array for binary search.
Iterative or
Recursive Search
- Can save some time and space by using iterative version of a search.
- Using recursion will not require much additional space for recursive
calls.
- Coding binary search recursively is somewhat easier.
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
Project v final submission is due thursday, april 26. The contribution report and ethics discussion are both due sunday, april 29. Opendsa homework on trees is due monday, april 30. log in computer science refers to base 2 (recall ~ 2=2). Major efficiency jump compared to using a loop / using contains. Must have a sorted array for binary search. Can save some time and space by using iterative version of a search. Using recursion will not require much additional space for recursive calls. Coding binary search recursively is somewhat easier.