Searching: binary search, interpolation search
Here we present some approaches for searching certain linear structures.
Readings: Textbook, chapter 7 (searching)
Supplemental materials:
Comprehension check:
- Given an unsorted vector or linked list, linear search has a complexity of __________.
- If we have a sorted vector, we can achieve O(log n) search complexity using ________________.
- If a structure has random access it means that we can access any element in that structure via some index. Which of the following sorting methods requires random access: linear search, binary search, interpolation search.
- If data are more-or-less uniformly distributed, then we can make very good guesses about where to find data within a linear structure. One method that takes advantage of this is ________________.
- Under the right conditions, interpolation search can achieve performance of O(____________).
Answers: u ƃol ƃol / ɥɔɹɐǝs uoᴉʇɐlodɹǝʇuᴉ / ɥɔɹɐǝs uoᴉʇɐlodɹǝʇuᴉ puɐ ɥɔɹɐǝs ʎɹɐuᴉq / ɥɔɹɐǝs ʎɹɐuᴉq / (u)O
Copyright © 2023–2025 Clayton Cafiero
No generative AI was used in producing this material. This was written the old-fashioned way.