हिंदी

In insertion sort average number of comparisons required to place the 7th element into the correct position is: -

Advertisements
Advertisements

प्रश्न

In insertion sort average number of comparisons required to place the 7th element into the correct position is:

विकल्प

  • 2

  • 7

  • 4

  • 9

MCQ

उत्तर

4

Explanation:

(k + 1)/2 is the average number of comparisons necessary to place the 7th element in the correct position. Here, k = 7. As a result, the total number of comparisons is (7 + 1)/2 = 8/2 = 4.

shaalaa.com
Insertion Sort
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×