Recall & Review
beginner
What is a search operation in computing?
A search operation is the process of looking through data to find a specific item or value. It is like looking for a book in a library by checking each shelf until you find the right one.
Click to reveal answer
intermediate
Explain the difference between linear search and binary search.
Linear search checks each item one by one until it finds the target. Binary search works on sorted data by repeatedly dividing the search area in half, quickly narrowing down where the target is.
Click to reveal answer
beginner
What is the main requirement for using binary search?
The data must be sorted in order (like numbers from smallest to largest) before you can use binary search.
Click to reveal answer
intermediate
Why is binary search faster than linear search on large data sets?
Because binary search cuts the search area in half each time, it finds the item much faster than checking every item one by one like linear search.
Click to reveal answer
beginner
What does a find operation return if the item is not found?
It usually returns a special value like -1 or 'not found' to show the item is not in the data.
Click to reveal answer
Which search method checks each item one by one?
✗ Incorrect
Linear search goes through each item in order until it finds the target.
What must be true about data to use binary search?
✗ Incorrect
Binary search requires sorted data to work correctly.
If a search does not find the item, what is a common result?
✗ Incorrect
Returning -1 or 'not found' signals the item is missing.
Which search is generally faster on large sorted lists?
✗ Incorrect
Binary search quickly narrows down the search area by halving it each step.
What is the first step in a linear search?
✗ Incorrect
Linear search starts by checking the first item and moves forward.
Describe how linear search works using a real-life example.
Think about searching through a pile of papers for a specific note.
You got /3 concepts.
Explain why binary search is more efficient than linear search on sorted data.
Imagine looking for a word in a dictionary.
You got /4 concepts.