Insertion sort in 2 minutes

preview_player
Показать описание
Step by step instructions showing how to run insertion sort.

Sources:

Рекомендации по теме
Комментарии
Автор

7 years later and this is still so much better than what I had at my university, thank you so much!

Crowmeir
Автор

Your videos sum up my classes in just a couple of minutes. Amazing work!! Life saver!

tiagolopes
Автор

These fucking videos are goddamn incredible. My god, Michael, this is just absolutely mind-blowing that you can illustrate in 2:18 what I've been wrestling with for the past few hours.

DanT-iuoc
Автор

Better explained than the CS500 tutorial (Harvard), thanks Michael.

dalskiBo
Автор

Thank you very much! Python code:

A = [2, 8, 5, 3, 9, 4]
for i in range(len(A)):
pointer = A[i]
left = A[i-1]
print(f"Array: {A}")
while i > 0 and left > pointer:
print(f" Swapping {pointer} & {left}")
A[i], A[i-1] = left, pointer
pointer, left = A[i-1], A[i-2]
i -= 1
else: print(f" Done")
else: print(f"Results: {A}")

Output:
Array: [2, 8, 5, 3, 9, 4]
Done
Array: [2, 8, 5, 3, 9, 4]
Done
Array: [2, 8, 5, 3, 9, 4]
Swapping 5 & 8
Done
Array: [2, 5, 8, 3, 9, 4]
Swapping 3 & 8
Swapping 3 & 5
Done
Array: [2, 3, 5, 8, 9, 4]
Done
Array: [2, 3, 5, 8, 9, 4]
Swapping 4 & 9
Swapping 4 & 8
Swapping 4 & 5
Done
Results: [2, 3, 4, 5, 8, 9]

jsteezeful
Автор

Insertion sort is just the improved version of bubble sort

awawpogi
Автор

wow so straight forward and clear and concise exactly the opposite of my teachers lecture notes haha

SharpSteelz
Автор

Watching this at 1 AM and it's totally worth it!

introvertsenpai
Автор

I played this at 2x speed so I could learn it in 1 minute then spent all my free time typing this comment

Pokemoki
Автор

You are a god send for these videos. Explaining perfectly in 3mins for what took my teacher 30

Mars
Автор

0:10 Explanation
0:29 Demo
1:50 Pseudocode
1:54 Big O Notation for an Insertion Sort

latedeveloper
Автор

You're doing students a great favour, thank you :)

pragathesi
Автор

Fantastic, love it, please consider posting such incredible, crisp yet easy to digest videos on data structures and algorithms

RideLikeAChamp
Автор

XD i can't believed i was so confused about this 3 mins ago

mysticstardust
Автор

Omg, thanks a lot man, I understood all types of sorts in less than 15 minutes, while my stupid professor spent several weeks. You are awesome!

jafar_u
Автор

This two minute video is better than every single long article or video on the same subject. Thanks!

AntiContent
Автор

Bro your helping and saving my A Levels with these. Keep it up and thanks a lot. Underrated.

Rahmzzz.
Автор

Anyone else here for paper 2 in a couple hours 😭🙏

devildoesstuff
Автор

have never seen anything more simple and easy to understand. Ridiculously simple!

louggy
Автор

You are incredable, man! This playlist is the best i've ever seen! Congrats!! And thank you so much!

maxwendellgarciasantana