Computer Science - 1 Fundamentals of Algorithms - 4 Searching Algorithms

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

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

7 Terms

1
New cards

What is 'searching' in computing?

using a program to look through a list to find a value

2
New cards

What search would you use for a sorted list?

binary search

3
New cards

What search would you use for an unsorted list?

linear search

4
New cards

Binary search [3]

- look at middle value (if even set, use before midpoint)
- discard half without item
- repeat with kept half until item found or not found (not in set)

5
New cards

Linear search

an algorithm that iterates through each item in a list until it finds the target value.

6
New cards

In a sorted list of 2ⁿ items the maximum number of items you need to search is equal to:

n + 1

7
New cards

If the length of the sequence does not fit exactly into 2ⁿ:

use the lower exponent (e.g. 15 is 2³ rather than 2⁴)