As sorting is a fundamental task in computing, the need is to understand its functionality, working and implementation. Different methods of sorting are available. The aim of this virtual lab is to explain the simplest incremental sorting method insertion sort, with the help of examples.
The working of insertion sort is similar to that of sorting of playing cards in hands. Cards are divided into two parts viz. sorted and unsorted. Initially, first card in hand is the only card in sorted part and remaining cards constitute the unsorted part. Subsequently, the first card from the unsorted part is picked and placed in sorted part at the appropriate position that leads to expansion of sorted part and reduction of the unsorted part of the cards.
Mr. Nilesh Pandey, B.Sc(H) Computer Science, II year,
Ms. Ananya Shukla, B.Sc(H) Computer Science, II year,
Mr. Amitesh Kumar Singh, B.Sc(H) Computer Science, II year.
Mentors:
Prof. Sharanjit Kaur,
Ms. Gunjan Rani
Simulation is divided into two modules. The first module allows the user to step-by-step analyze the working of the algorithm on arrays. In the next module, some exercises are provided so that the user can have a hands-on experience with the algorithm.
You will see a line by line execution of code i.e. how each line of insertion sort algoritm affects the unsorted array in order to sort it.
Try Yourself section presents some incomplete code snippets. You will try and complete those.
Mr. Shahnawaj Khan, B.Sc(H) Computer Science.
Mentors:
Prof. Sharanjit Kaur,
Ms. Nishu Singh