Data Structure MCQ - Shell Sort
Q1.What is the other name for a shell sort algorithm?
- Diminishing increment sort
- Diminishing decrement sort
- Insertion sort
- Selection sort
Answer:- (A).
Explanations : Clarification: The other name for a shell sort algorithm is diminishing decrement sort as the distance between comparisons decreases as the algorithm runs until the last phase.
Explanations : Clarification: The other name for a shell sort algorithm is diminishing decrement sort as the distance between comparisons decreases as the algorithm runs until the last phase.
- O(N)
- O(N log N)
- O(log N)
- O(N2)
Answer:- (D).
Explanations :The lower bound of a shell sort algorithm is mathematically found to be O(N2)
Explanations :The lower bound of a shell sort algorithm is mathematically found to be O(N2)
- O(1)
- O(n)
- O(logn)
- O(n logn)
Answer:- (B).
- John Von Neumann
- Donald Shell
- Tony Hoare
- Alan Shell
Answer:- (B).
Explanations : Clarification: Shell sort algorithm is invented by Donald shell. Merge sort is invented by John Von Neumann. Quick sort is invented by Tony Hoare.
Explanations : Clarification: Shell sort algorithm is invented by Donald shell. Merge sort is invented by John Von Neumann. Quick sort is invented by Tony Hoare.
- Selection sort
- Merge sort
- Insertion sort
- Bucket sort
Answer:- (C).
Explanations :Shell sort performs an insertion sort on hk independent arrays. It is mainly a variation of insertion sort.
Explanations :Shell sort performs an insertion sort on hk independent arrays. It is mainly a variation of insertion sort.
- for(increment=N/2;increment>0;increment/=2)
- for(i=1;i< n;i++)
- for(i=n/2;i>=0;i- -)
- for(i=0;i< n;i++;numelements- -)
Answer:- (A).
Explanations : for(increment=N/2;increment>0;increment/=2) represents shell sort, for(i=1;i< n;i++) represents insertion sort, for(i=n/2;i>=0;I- -) represents heap sort, for(i=0;i< n;i++;numelements- -) merge sort.
Explanations : for(increment=N/2;increment>0;increment/=2) represents shell sort, for(i=1;i< n;i++) represents insertion sort, for(i=n/2;i>=0;I- -) represents heap sort, for(i=0;i< n;i++;numelements- -) merge sort.
- External sorting
- Internal sorting
- In-place sorting
- Bottom-up sorting
Answer:- (B).
Explanations :Shell sort is an example of internal sorting because sorting of elements is done internally using an array.
Explanations :Shell sort is an example of internal sorting because sorting of elements is done internally using an array.
- O(N2)
- O(N3/2)
- O(N4/3)
- O(N5/4)
Answer:- (C).
Copyright © 2022 Shineskill Software Pvt. Ltd., All rights reserved.