Data Structure Questions and Answers-Selection Sort

DOWNLOAD FREE PDF <<CLICK HERE>>

Data Structure Questions and Answers-Selection Sort

Congratulations - you have completed Data Structure Questions and Answers-Selection Sort.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%


Your answers are highlighted below.
Question 1 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
What is an in-place sorting algorithm?
A
It needs O(1) or O(logn) memory to create auxiliary locations
B
The input is already sorted and in-place
C
It requires additional storage
D
None of the mentioned
English grammar Questions answers
Question 1 Explanation: 
Auxiliary memory is required for storing the data temporarily.

Question 2 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
In the following scenarios, when will you use selection sort?
A
The input is already sorted
B
A large file has to be sorted
C
Large values need to be sorted with small keys
D
Small values need to be sorted with large keys
NTA NET study material
Question 2 Explanation: 
Selection is based on keys, hence a file with large values and small keys can be efficiently sorted with selection sort.

Question 3 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
What is the worst case complexity of selection sort?
A
O(nlogn)
B
O(logn)
C
O(n)
D
O(n2)
Civics Test Questions answers
Question 3 Explanation: 
Selection sort creates a sub-list, LHS of the 'min' element is already sorted and RHS is yet to be sorted. Starting with the first element the 'min' element moves towards the final element.

Question 4 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
Select the appropriate code that performs selection sort.
A

 int min; for(int j=0; j<arr.length-1; j++) { min = j; for(int k=j+1; k<=
B

 int min; for(int j=0; j<arr.length-1; j++) { min = j; for(int k=j+1; k
C

 int min; for(int j=0; j<arr.length-1; j++) { min = j; for(int k=j+1; k<=<
D

 int min; for(int j=0; j<arr.length-1; j++) { min = j; for(int k=j+1; k<=<
Biology Questions answers
Question 4 Explanation: 
Starting with the first element as 'min' element, selection sort loops through the list to select the least element which is then swapped with the 'min' element.

Question 5 [CLICK ON ANY CHOICE TO KNOW MCQ multiple objective type questions RIGHT ANSWER]
What is the advantage of selection sort over other sorting techniques?
A
It requires no additional storage space
B
It is scalable
C
It works best for inputs which are already sorted
D
It is faster than any other sorting technique
Aptitude Questions answers
Question 5 Explanation: 
Since selection sort is an in-place sorting algorithm, it does not require additional storage.

Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 5 questions to complete.

DOWNLOAD FREE PDF <<CLICK HERE>>