• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | Quiz for Sudo GATE 2021 | Question 17

Consider the following list of the integer:
19, 23, 40, 32, 91, 25, 100, 36 
Sort this list in increasing order using insertion sort and determine the number of passes, comparisons, and swaps. Here a pass means iteration of main loop. We may assume that we start checking from first element which is 19 here. Note - This question is multiple select questions (MSQ).

(A)

There will be total 8 passes for all 8 integers

(B)

Number of comparisons and Swaps for each pass for given sequences to sort in increasing order are 14 and 7 respectively

(C)

Number of comparisons for each pass for given sequences to sort in increasing order is 7

(D)

Number of swaps for each pass for given sequences to sort in increasing order is 14

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments