Fundamentals of algorithms

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/5

flashcard set

Earn XP

Description and Tags

searching, sorting lists

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

6 Terms

1
New cards

list the details describing a linear search

Does not have to be sorted.

Search only terminates when element is found or end of list is reached (meaning item is not in list)

Best case scenario: first item

Worst case scenario: last item

Uses while loop for increase in efficiency

2
New cards

how do linear searches work?

knowt flashcard image
3
New cards

what is the time complexity of a linear search

O(n)

4
New cards

list the details describing a binary search

lists needs to be sorted

more efficient than linear search

Best case scenario: first midpoint

Worst case scenario: Log2(n)

5
New cards

how do binary searches work?

knowt flashcard image
6
New cards

how to find worst case scenario: binary search

knowt flashcard image