What is the primary purpose of Selection Sort?
A) To search for an element
B) To sort an array
C) To merge two arrays
D) To partition data
Answer: B) To sort an array
What is the worst-case time complexity of Selection Sort?
A) O(n)
B) O(n log n)
C) O(n^2)
D) O(log n)
Answer: C) O(n^2)
Which statement best describes how Selection Sort works?
A) It compares adjacent elements and swaps them.
B) It repeatedly selects the smallest element from the unsorted portion and places it at the beginning.
C) It divides the array into two halves and sorts them independently.
D) It uses a divide-and-conquer approach to sort the array.
Answer: B) It repeatedly selects the smallest element from the unsorted portion and places it at the beginning.
What is the best-case time complexity of Selection Sort?
A) O(n)
B) O(n log n)
C) O(n^2)
D) O(log n)
Answer: C) O(n^2)
Which of the following is true about the stability of Selection Sort?
A) It is a stable sorting algorithm.
B) It is not a stable sorting algorithm.
C) It can only sort numerical data.
D) It requires additional memory for stability.
Answer: B) It is not a stable sorting algorithm.
What is the average-case time complexity of Selection Sort?
A) O(n)
B) O(n log n)
C) O(n^2)
D) O(log n)
Answer: C) O(n^2)
In Selection Sort, what happens to the elements in the unsorted portion of the array?
A) They are ignored until the next pass.
B) They are sorted simultaneously.
C) They are selected one by one to find the minimum.
D) They are rearranged randomly.
Answer: C) They are selected one by one to find the minimum.
How many comparisons are made in the worst case during Selection Sort?
A) n
B) n/2
C) n^2
D) n(n-1)/2
Answer: D) n(n-1)/2
Which algorithm is generally less efficient than Selection Sort for large datasets?
A) Insertion Sort
B) Merge Sort
C) Bubble Sort
D) Quick Sort
Answer: C) Bubble Sort
What is the space complexity of Selection Sort?
A) O(1)
B) O(n)
C) O(n log n)
D) O(n^2)
Answer: A) O(1)
In which of the following scenarios is Selection Sort particularly useful?
A) Sorting large datasets
B) Sorting small datasets
C) Real-time data processing
D) When memory usage is a concern
Answer: B) Sorting small datasets
What happens to the number of passes made by Selection Sort as the size of the array increases?
A) It decreases.
B) It remains constant.
C) It increases linearly.
D) It increases quadratically.
Answer: C) It increases linearly.
What is the output of Selection Sort if the input array is [4, 3, 2, 1]?
A) [1, 2, 3, 4]
B) [4, 3, 2, 1]
C) [2, 1, 3, 4]
D) [3, 4, 1, 2]
Answer: A) [1, 2, 3, 4]
How does Selection Sort compare to Bubble Sort in terms of efficiency?
A) It is more efficient.
B) It is less efficient.
C) They are equally efficient.
D) It depends on the dataset.
Answer: A) It is more efficient.
Which of the following statements about Selection Sort is incorrect?
A) It is easy to implement.
B) It can be done in place.
C) It is not suitable for large datasets.
D) It is always stable.
Answer: D) It is always stable.
How does the Selection Sort algorithm determine the next smallest element?
A) By comparing adjacent elements.
B) By scanning the entire unsorted portion of the array.
C) By using a recursive function.
D) By maintaining a sorted list.
Answer: B) By scanning the entire unsorted portion of the array.
What will be the result of applying Selection Sort to the array [5, 2, 9, 1, 5, 6]?
A) [1, 2, 5, 5, 6, 9]
B) [5, 5, 6, 1, 2, 9]
C) [9, 6, 5, 5, 2, 1]
D) [1, 5, 2, 6, 9, 5]
Answer: A) [1, 2, 5, 5, 6, 9]
What is the main reason for the inefficiency of Selection Sort?
A) It requires too much memory.
B) It makes too many comparisons.
C) It uses recursion.
D) It does not work well with duplicates.
Answer: B) It makes too many comparisons.
Which sorting algorithm is commonly used in educational settings to illustrate sorting concepts?
A) Quick Sort
B) Merge Sort
C) Selection Sort
D) Heap Sort
Answer: C) Selection Sort
What is the effect of using Selection Sort on an already sorted array?
A) It sorts the array again.
B) It remains unchanged.
C) It reverses the array.
D) It becomes unstable.
Answer: B) It remains unchanged.
In Selection Sort, which element is selected first?
A) The largest element
B) The smallest element
C) The middle element
D) The last element
Answer: B) The smallest element
What type of sorting is Selection Sort classified as?
A) In-place sorting
B) External sorting
C) Comparison-based sorting
D) All of the above
Answer: D) All of the above
Which characteristic of Selection Sort makes it less suitable for large datasets?
A) It uses too much memory.
B) It requires multiple passes through the array.
C) It cannot handle negative numbers.
D) It only sorts in ascending order.
Answer: B) It requires multiple passes through the array.
What would happen if Selection Sort is applied to an array with only one element?
A) The array will be sorted.
B) An error will occur.
C) The array will remain unchanged.
D) The algorithm will loop indefinitely.
Answer: A) The array will be sorted.
How does Selection Sort handle duplicate elements?
A) It ignores them.
B) It sorts them randomly.
C) It maintains their relative order.
D) It treats them as distinct values.
Answer: D) It treats them as distinct values.
Which of the following is a limitation of Selection Sort?
A) It is a comparison sort.
B) It does not require extra space.
C) It is not adaptive.
D) It maintains stability.
Answer: C) It is not adaptive.
What type of data structure is typically used to implement Selection Sort?
A) Linked List
B) Array
C) Tree
D) Graph
Answer: B) Array
How many elements does Selection Sort need to sort?
A) At least one
B) At least two
C) At least three
D) At least four
Answer: B) At least two
In which of the following scenarios would Selection Sort perform the worst?
A) When the array is sorted
B) When the array is in reverse order
C) When all elements are equal
D) When the array has random values
Answer: B) When the array is in reverse order
What is the main idea behind the name “Selection Sort”?
A) It selects elements randomly.
B) It selects the largest elements first.
C) It selects the smallest elements repeatedly to build a sorted array.
D) It selects elements based on their index.
Answer: C) It selects the smallest elements repeatedly to build a sorted array.
How does Selection Sort achieve its sorting?
A) By swapping elements
B) By inserting elements
C) By comparing and selecting
D) By merging elements
Answer: C) By comparing and selecting
Which of the following is not a feature of Selection Sort?
A) It is an in-place sorting algorithm.
B) It is a stable sorting algorithm.
C) It works well for small lists.
D) It uses minimal additional memory.
Answer: B) It is a stable sorting algorithm.
What will be the result of applying Selection Sort to the array [3, 1, 4, 1, 5, 9, 2, 6]?
A) [1, 1, 2, 3, 4, 5, 6, 9]
B) [9, 6, 5, 4, 3, 2, 1, 1]
C) [4, 1, 3, 2, 5, 9, 6, 1]
D) [1, 2, 3, 4, 5, 6, 9, 1]
Answer: A) [1, 1, 2, 3, 4, 5, 6, 9]
What is the final position of the smallest element after one pass of Selection Sort?
A) It remains in its original position.
B) It is placed at the end of the array.
C) It is placed at the beginning of the sorted portion.
D) It is moved to the middle of the array.
Answer: C) It is placed at the beginning of the sorted portion.
How does Selection Sort handle sorted or partially sorted arrays?
A) It performs optimally.
B) It performs poorly.
C) It performs the same as random arrays.
D) It cannot handle them.
Answer: B) It performs poorly.
Which of the following sorting algorithms is based on a similar concept to Selection Sort?
A) Merge Sort
B) Quick Sort
C) Insertion Sort
D) Heap Sort
Answer: C) Insertion Sort
What will the result of Selection Sort be if it is applied to an empty array?
A) An error will occur.
B) The empty array will remain unchanged.
C) The array will be filled with zeros.
D) The algorithm will enter an infinite loop.
Answer: B) The empty array will remain unchanged.
Basic Concepts
Non-Linear Data Structures MCQs
Sorting and Searching Algorithms MCQs
- Data Structures MCQs 1
- Data Structures MCQs 2
- Data Structures MCQs 3
- Data Structures MCQs 4
- Data Structures MCQs 5
- Stacks Solved MCQs
- Queues MCQs
- pointer mcqs
- Array MCQs