Searching Flashcards
What is a sequential search?
A sequential search is an algorithm that checks each element of a list or array in order until the desired element is found or the list ends.
True or False: A sequential search can be used on both sorted and unsorted lists.
True
Fill in the blank: In a sequential search, the search starts from the ________ of the list.
beginning
Which of the following is an advantage of sequential search? (A) It is faster than binary search. (B) It can be used on unsorted data. (C) It requires less memory.
B) It can be used on unsorted data.
What type of data structure is typically used for a sequential search?
An array or a list.
True or False: A sequential search is more efficient than binary search for large datasets.
False
What is the best-case time complexity of a sequential search?
When the desired element is the first element in the list.
In which scenario would a sequential search be preferred over other search algorithms?
When dealing with small datasets or unsorted lists.
What is the primary limitation of sequential search?
Its inefficiency for large datasets compared to more advanced searching algorithms.
What is the primary purpose of a sequential search?
To find a specific item within a list or array by checking each element in order.
True or False: A sequential search can be performed on a sorted list more efficiently than on an unsorted list.
False
Which of the following scenarios is best suited for a sequential search? A) Searching in a large database B) Searching in a small, unsorted list C) Searching in a sorted array
B) Searching in a small, unsorted list
What is a key disadvantage of using a sequential search compared to other search algorithms?
It can be inefficient for large datasets as it may require examining every element.
What is the primary purpose of a sequential search?
To find a specific value in a list or array.
True or False: A sequential search is more efficient on a sorted array than on an unsorted array.
False.
Fill in the blank: A sequential search examines each element in the array in _____ order.
Linear.
What is the first step in performing a sequential search on a sorted array?
Start at the first element of the array.
Which of the following is a key characteristic of a sequential search? (A) Requires the array to be sorted (B) Can be used on any type of list (C) Has a logarithmic time complexity
B) Can be used on any type of list.
True or False: A sequential search can be optimized by skipping elements in a sorted array.
False.
What happens if the target value is not found during a sequential search?
The search will complete after checking all elements and indicate that the value is not present.
What type of search algorithm is a sequential search?
It is a linear search algorithm.
What is the primary purpose of binary search?
To efficiently find the position of a target value within a sorted array.
True or False: Binary search can be performed on unsorted arrays.
False
What condition must be satisfied for binary search to work?
The array must be sorted.