Gnome Sort Multiple choice Questions and Answers (MCQs)

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Gnome Sort Multiple choice Questions and Answers (MCQs)

Question 1
Gnome sort is also called .....
A
Smart sort
B
Stupid sort
C
Bogo sort
D
Special sort
Library science Questions answers
Question 1 Explanation: 
Gnome sort was originally named as stupid sort but later on it got renamed as gnome sort.

Question 2
How many loops are required to implement gnome sorting algorithm?
A
Single loop
B
2 nested loops
C
3 nested loops
D
It does not require any loop
Geography Questions answers
Question 2 Explanation: 
In this sorting algorithm the variable representing the index number is not incremented in case the adjacent pair of elements are out of place. In such a case its value is decremented instead. Thus it is able to implement sorting using a single loop.

Question 3
Which of the following pair of sorting algorithms are stable?
A
gnome sort and quick sort
B
merge sort and selection sort
C
gnome sort and merge sort
D
heap sort and merge sort
Arab culture Questions answers
Question 3 Explanation: 
Gnome sort and merge sort are stable sorting algorithms as the elements with identical values appear in the same order in the output array as they were in the input array when any of these sorting algorithms are implemented.

Question 4
Auxiliary space used by gnome sort is .....
A
O(1)
B
O(n)
C
O(log n)
D
O(n log n)
Home science Questions answers
Question 4 Explanation: 
Auxiliary space used by gnome sort is O(1) as it does not use any extra space for manipulating the input. Thus it also qualifies as an in place sorting algorithm.

Question 5
The given array is arr = {1, 2, 4, 3, 5}.The number of iterations required to sort the array using gnome sort will be .....
A
5
B
6
C
7
D
8
Biology Questions answers
Question 5 Explanation: 
6 iterations will be required as one pair of elements i.e. {4, 3} is out of place which causes the loop to take one step backward.

There are 5 questions to complete.

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<