12th Class Computers Science Sample Paper Python Revision Tour-Sample Paper-4

  • question_answer
    What will be the result after 3rd pass of insertion sort if applied on the following list?
    [16, 19, 11, 15, 10]

    A) [11, 15, 16, 19, 10] 

    B) [16, 19, 11, 15. 10]

    C) [16, 11, 15, 19, 10]        

    D) [16, 19, 10, 11, 15]

    Correct Answer: A

    Solution :

    [a] As per the insertion sort following are the passes of given code:
    After 1 Pass: [16 19 11 15 10]
    After 2 Pass: [11 16 19 15 10]
    After 3 Pass: [11 15 16 19 10]
    After 4 Pass: [10 11 15 16 19]


You need to login to perform this action.
You will be redirected in 3 sec spinner