Insertion Sort algorithm

preview_player
Показать описание
Insertion Sort - how it works.

For Full Course Experience Please Go To

Full Course Experience Includes
1. Access to course videos and exercises
2. View & manage your progress/pace
3. In-class projects and code reviews
4. Personal guidance from your Mentors
Рекомендации по теме
Комментарии
Автор

Best video I have come across that explains insertion sort.

jidejohnson
Автор

Because the last element in the sorted region is ONE element BEHIND the element you will be inserting into the sorted region.
Ex:
|1|4|6| |5|3|2|9|7|
sorted region unsorted region
'1' is index 0, '4' is index 1, '6' is index 2, '5' is index 3, etc. If j = 3, it refers to index 3 which is '5' and the element BEFORE it, index 2 is j-1 = 3-1 = 2.

JuneJuly
Автор

J-1 means Comparing Jth element with it's left neighbour because we are going to sort a list in Ascending order where

yug
Автор

just improve the accent, it deserves much more likes.

swapanjain
Автор

Because we are Comparing Our Current Element with it's left neighbours which are already Sorted(Left neighbours of Current Element)

yug
Автор

I finally understand this!!!! thank you

helenjones
Автор

j-1 is the last element in the sorted region.

JuneJuly
join shbcf.ru