105 Lecture Notes - Lecture 1: Binary Search Algorithm

10 views1 pages

Document Summary

A classic algorithm for binary search has a logarithmic time complexity. This algorithm starts by creating two pointers: one at the beginning and one at the end of the array. Then, it selects a midpoint between the two pointers and checks if the value being searched for is found at the midpoint. Regardless of whether the value is found or not, it discards one half of the array and adjusts either the high or low pointer accordingly. This is the first part of a two-part video series on arrays. Arrays are fundamental building blocks for all other data structures, and with arrays and pointers alone, it is possible to construct nearly any data structure. A static array is a fixed-length container containing elements. The access time for static array and a dynamic array is constant.

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