Q.1
Shell sort is also known as _____________
  • a) diminishing decrement sort
  • b) diminishing increment sort
  • c) partition exchange sort
  • d) diminishing insertion sort
Q.2
StatementShell sort is a stable sorting algorithm.
  • a) Both statements are true
  • b) Statement 2 is true but statement 1 is false
  • c) Statement 2 is false but statement 1 is true
  • d) Both statements are false
Q.3
Shell sort is applied on the elementsand the chosen decreasing sequence of increments is (5,3,1). The result after the first iteration will be
  • a) 27 59 49 37 15 90 81 39
  • b) 27 59 37 49 15 90 81 39
  • c) 27 59 39 37 15 90 81 49
  • d) 15 59 49 37 27 90 81 39
Q.4
Consider the following code snippet, which implements the Shell sort algorithm. shellSort( int elements[], int num_elements , int incrmnts[], int num_incrmnts) { int incr, j, k, span, y; for(incr =incr ;&lt num_incrmnts; incr++) { span = incrmnts[incr]; data-structure-questions-answers-shell-sort for( j = span; j < num_elements; j++) { k = j; y = elements[j]; while (________ ) { elements [ k] = elements[k - span]; k = k - span; } elements[k] = y; } }
  • a) k >= j && y < elements[k- span]    
  • b) k >= span || y < elements[k + span]    
  • c) k >= j || y < elements[k + span]    
  • d) k >= span && y < elements[k- span]    
Q.5
Shell sort is an improvement on ____
  • a) insertion sort
  • b) selection sort
  • c) binary tree sort
  • d) quick sort
Q.6
An array that is first 7-sorted, then 5-sorted becomes _________
  • a) 7-ordered
  • b) 5-ordered
  • c) both 2-ordered and 5-ordered
  • d) both 7-ordered and 5-ordered
Q.7
If Hibbard increments (hhh…, hk = 2k–are used in a Shell sort implementation, then the best case time complexity will be ________
  • a) O(nlogn)
  • b) O(n)
  • c) O(n2)
  • d) O(logn)
Q.8
Records RRR3,.. RN with keys KKK3,.. KN are said to be h-ordered, if ________
  • a) Ki <= Ki+h for 1<= i*h <= N
  • b) Kh <= Ki+h for 1<= i <= N
  • c) Ki <= Kh for 1<= i <= h
  • d) Ki <= Ki+h for 1<= i <= N-h
Q.9
Shell sort is more efficient than insertion sort if the length of input arrays is small.
  • a) True
  • b) False
Q.10
Which of the following is true?
  • a) Shell sort’s passes completely sort the elements before going on to the next-smallest gap while Comb sort’s passes do not completely sort the elements
  • b) Shell sort’s passes do not completely sort the elements before going on to the next-smallest gap like in Comb sort
  • c) Comb sort’s passes completely sort the elements before going on to the next-smallest gap like in Shell sort
  • d) Shell sort’s passes do not completely sort the elements before going on to the next-smallest gap while Comb sort’s passes completely sort the elements
0 h : 0 m : 1 s