Insertion Sort - CS50 Shorts

preview_player
Показать описание

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

Hopefully Izod will sign Doug to a golf shirt sponsorship deal soon. Fresh shirts in every video.

aaroncarvermail
Автор

Thanks Doug, this is by far the best explanation on insertion sort!

TimYear
Автор

Ended up here after seeing "insertion sort" mentioned in the average temperatures practice exercise's instructions. Wondering why this video is not included in the courses' page as the merge, selection and bubble sort are?
Just seeing this video (haven't tried figuring out how to code this yet) it seems the least intuitive of all 4, and as bad as selection sort. Is that why it got removed from the course?

ashkiin
Автор

This feels like bubble sort with extra steps

pramitgautam
Автор

Why wasn't this in the lecture though

markmarki
Автор

i love you thank you helped me in my computing lesson

thomasbeckley
Автор

Doug saving programmers' lives since 2017 :)

mahaagro
Автор

wasn't this guy in 21 Jump Street?

this_rishi
Автор

Could someone explain more about how he got O(n^2)?

tiakimx
Автор

Wouldn't it be quicker to create a new empty array and start building it up with the elements, instead of continuously shifting elements in the original array?

My only guess as to why this would be worst, is that it might make the program heavier in memory.

splodys
Автор

What week does this belong to? I can't find it on the CS50 website

TypicallyThomas
Автор

Why don't you include pseudocode? Great visualisation apart from that.

IMADETHISACCFORRAY
Автор

Had to double check my monitor because of the artifacts on his neck.

ValentinSharonov
Автор

When I try to sort an array of numbers, the way I calculate it, it every element only gets shifted (n - 1) times. For example for list of 4, 3, 2, 1: Wouldn't each element only shift 3 positions? So 4 elements * 3 shifts each = total of 12 shifts? so n * (n - 1) shifts?

But Doug says each of the n elements gets shifted n times. I don't understand how each element could shift n times? for example if 4 shifted 4 times wouldn't it go over the available number of indexes in the array?

arcadeeeee
Автор

Inmate shirt? Broadcasting from the prison?

bivshiyzek
Автор

What is the name of the CS50 course explaining all the sort algorithms?

Enskkc