Chapter-5 Sorting — Online MCQ Test
COMPUTER SCIENCE · Grade 12 · CBSE(NCERT)
Practice Chapter-5 Sorting with a free chapter-wise online MCQ test.
This chapter covers: bubble sort - insertion sort.
AI-generated questions from basic to board-exam level, with instant results and explanations.
Chapter-5 Sorting — Important Questions & Answers
What is the primary characteristic of Linear Search?
- A. It searches elements sequentially from the beginning
- B. It requires the array to be sorted
- C. It divides the array into halves
- D. It uses divide and conquer strategy
Answer: A. It searches elements sequentially from the beginning
Linear search checks each element one by one from the start until the target is found, regardless of whether the array is sorted or not.
Linear search checks each element one by one from the start until the target is found, regardless of whether the array is sorted or not.
Which search algorithm requires the array to be sorted?
- A. Linear Search
- B. Binary Search
- C. Jump Search
- D. Both B and C
Answer: D. Both B and C
Binary Search and Jump Search both require a pre-sorted array to work correctly, as they rely on the sorted order to eliminate portions of the search space.
Binary Search and Jump Search both require a pre-sorted array to work correctly, as they rely on the sorted order to eliminate portions of the search space.
Which sorting algorithm has the same best, average, and worst-case time complexity?
- A. Bubble Sort
- B. Insertion Sort
- C. Selection Sort
- D. Quick Sort
Answer: C. Selection Sort
Selection Sort always has O(n²) complexity regardless of input order because it always performs n(n-1)/2 comparisons to find the minimum element in each pass.
Selection Sort always has O(n²) complexity regardless of input order because it always performs n(n-1)/2 comparisons to find the minimum element in each pass.
Compare Linear Search and Binary Search: when is Linear Search preferable to Binary Search?
- A. Linear Search is always preferable
- B. When the array is small and unsorted
- C. When the array is large and sorted
- D. They always have the same efficiency
Answer: B. When the array is small and unsorted
For small unsorted arrays, the overhead of sorting for Binary Search makes Linear Search more practical despite its O(n) complexity.
For small unsorted arrays, the overhead of sorting for Binary Search makes Linear Search more practical despite its O(n) complexity.
In a highly competitive exam scenario, searching 10^7 records for a specific ID where records are sorted by ID, which algorithm combination would be optimal and why?
- A. Linear Search because it's simpler
- B. Bubble Sort followed by Linear Search for accuracy
- C. Binary Search directly on the sorted records to minimize comparisons
- D. Insertion Sort to maintain sorted order during search
Answer: C. Binary Search directly on the sorted records to minimize comparisons
Binary Search on 10^7 sorted records requires only ~23 comparisons worst case, far superior to Linear Search's 10^7 comparisons, making it optimal for this competitive scenario.
Binary Search on 10^7 sorted records requires only ~23 comparisons worst case, far superior to Linear Search's 10^7 comparisons, making it optimal for this competitive scenario.