Paper 2 - Search Algorithms

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

1/7

Last updated 9:36 AM on 3/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

8 Terms

1
New cards

how do you perform a binary search

  1. find the middle item in the ordered list

  2. if this is the item you’re looking for then stop the search

  3. if not, compare the item you’re looking for to the middle item. If it comes before the middle item, get rid of the second half of the list. If it comes after the middle item, get rid of the first half of the list

  4. you will be left with half the size of the original list

  5. repeat steps 1-4 on the smaller list and keep going until you find the item you’re looking for

2
New cards

what is a negative about the binary search

the list must be ordered

3
New cards

how do you perform a linear search

  1. look at the first item in the unordered list

  2. If this item you’re looking for, then stop the search

  3. If not, then look at the next item in the list

  4. Repeat steps 2-3 until you find the item that you’re looking for or you’ve checked every item

4
New cards

why are linear searches usually used on small lists

they are inefficient

5
New cards

a linear search is much … than a binary search but not as efficient

simpler

6
New cards

what are the benefits of linear search

does not have to be ordered

can be used on any type of list

simpler than a binary search

7
New cards

what is a benefit of binary search

more efficient that a linear search

8
New cards

why are binary searches more suitable for larger lists

takes fewer steps than a linear search