What is Linear search primarily used for?
- A. A search algorithm that checks each element in a list sequentially until the target value is found. ✓
- B. An algorithm that computes shortest paths from a single source vertex in a graph, even with negative edge weights.
- C. A measure of the amount of memory an algorithm uses as a function of input size.
- D. A greedy algorithm that finds a minimum spanning tree for a connected, weighted graph by adding edges in increasing order of weight.
Correct answer
A. A search algorithm that checks each element in a list sequentially until the target value is found.
Explanation
Linear search refers to a search algorithm that checks each element in a list sequentially until the target value is found.