1.6 Linear Search and Binary Search

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

flashcard set

Earn XP

Description and Tags

8.24.26 Class Review

Last updated 2:14 AM on 8/26/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

13 Terms

1
New cards

What does Linear Search do?

It checks elements one at a time until it finds the desired value or reaches the end.

2
New cards

What is the runtime complexity of Linear Search?

O(N)

3
New cards

What is the best case for Linear Search?

The key is the first element

4
New cards

What is the worst case for Linear Search?

The key is not found or is at the last position, requiring all elements to be checked.

5
New cards

If Linear Search finds the key in the middle of the array, is that best or worst?

Neither

6
New cards

Why is Linear Search O(N)?

In the worst case, it may have to check all N elements.

7
New cards

What is a Binary Search?

A search algorithm that repeatedly divides the search area in half.

8
New cards

What is required for Binary Search?

The data must be ordered/sorted.

9
New cards

What is the runtime complexity of Binary Search?

O(log N)

10
New cards

Why is Binary Search faster than Linear Search for large inputs?

It eliminates about half of the remaining search area after each comparison.

11
New cards

What is the major difference between Linear Search and Binary Search?

Linear Search checks items one at a time; Binary Search repeatedly cuts the the search area in half.

12
New cards

What is the key requirement that Linear Search does not have?

Binary Search requires the data to be sorted.

13
New cards