Monday, December 1, 2014

CLRS 3e 2.2-1

2.1-1 Using Figure 2.2 as a model, illustrate the operation of INSERTION-SORT on the

array A = <31,41,59,26,41,58>

We start with A = <31,41,59,26,41,58>

A = <31,41,59,26,41,58>   //No Swaps (compare 31 < 41)
     
A = <31,41,59,26,41,58>   //No Swaps (compare 41 < 59)
              
A = <31,41,26,59,41,58>   //Swap 59 and 26 (59 > 26)

A = <31,26,41,59,41,58>   //Swap 26 and 41 (41 > 26)

A = <26,31,41,59,41,58>   //Swap 26 and 31 (31 > 26)

A = <26,31,41,41,59,58>   //Swap 59 and 41 (59 < 41)

A = <26,31,41,41,58,59>   //Swap 58 and 59 (59 > 58)




1 comment:

  1. Thanks for the always useful information, A1 True Jobs is a Search Engine for Jobs, Projects & Talents | Web Portal of Employers, Freelancers & Jobseekers | A1 True Jobs

    * Latest Job Openings
    * Latest Freelance Projects
    * Profiles - Jobseekers & Freelancers

    Note : Explore our blog in Career Advice, Resumes & Cover Letters, Stress Management, Jobs and Careers.

    For more information visit our website at A1 True Jobs

    ReplyDelete