Merge sort in 3 minutes

Merge sort in 3 minutes

Michael Sambol

7 лет назад

1,134,512 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@ob2344
@ob2344 - 25.11.2023 01:44

great vid! simple and easy to understand for a review

Ответить
@drditup
@drditup - 21.11.2023 11:54

this is amazing. no fluff, no babbling. just a direct explanation. im so used to people talking for an extra 20 minutes when this is all it takes. great, just great

Ответить
@IgorKuts
@IgorKuts - 18.11.2023 13:03

Internet Gold.

Ответить
@waelltifi-2023
@waelltifi-2023 - 10.11.2023 11:52

i hate this kind of sort , it is not pretty and i don't know how is this performant

Ответить
@cristianmendoza9440
@cristianmendoza9440 - 08.11.2023 20:09

new sub! great videos! thanks ! we need another video with RadixSort please!

Ответить
@georgetait386
@georgetait386 - 26.10.2023 23:28

could this be made in linear time by representing arrayOne, arrayTwo as linkedLists? that way removing the first element is constant time, rather than linear time?

I.e in the first while loop of the merge function, there is a command remove a[0] from a. This is O(n), since all the other elements in the array need to be shifted to the left. However, with linked lists, this corresponds to removing the head of the list, which is O(1). Can't see any potential issues with using linked lists elsewhere? Would just have to write splicing functionality for them.

Edit: I am going to try and implement both ways, the way in this video and using a linked list and see what the results are. Will reply to this comment when I have a result

Ответить
@thevendetta9726
@thevendetta9726 - 26.10.2023 17:49

dumb ass video

Ответить
@willmartin1748
@willmartin1748 - 25.10.2023 02:34

Please do a video on how the actual recursive stack works with this algorithm. That's the confusing part for me.

Ответить
@aj1809
@aj1809 - 23.10.2023 23:35

what is n?

Ответить
@harisahmad7871
@harisahmad7871 - 04.10.2023 16:25

This was a miss, this is not really how you do it algorithmically, way too simplified

Ответить
@arevikkhachatryan9944
@arevikkhachatryan9944 - 03.10.2023 16:48

thank you very much, its very helpful

Ответить
@hibakhan9764
@hibakhan9764 - 29.09.2023 16:59

this is exactly what i was looking for

Ответить
@adimihir
@adimihir - 22.09.2023 18:40

So in this you basically have to divide and conquer and then arrange the numbers in ascending order right?

Ответить
@humanrace6224
@humanrace6224 - 11.09.2023 13:55

what to do when there is odd number?

Ответить
@matts8791
@matts8791 - 10.09.2023 05:33

Awesome video, way better than my professor!

Ответить
@forprogramming8541
@forprogramming8541 - 05.09.2023 16:52

Thanks for your videos sir. I got an "A" for data structures and algorithms module.

Ответить
@erikle4930
@erikle4930 - 28.08.2023 19:45

RESPECT

Ответить
@aniruddhkarekar2818
@aniruddhkarekar2818 - 24.08.2023 18:54

Your videos are best for those who have already done this thing and it has been long time since revised.

Ответить
@ben_QL
@ben_QL - 29.07.2023 06:24

what will happen if the element of array is odd?

Ответить
@zuku_kimika
@zuku_kimika - 28.07.2023 13:06

thnk u , it help me

Ответить
@capybara8134
@capybara8134 - 11.07.2023 16:54

Thank you so much. Looked at my uni lecture slides and dint understand a single bit of it. Watched your vids and totally understood it. Thank you very much❤

Ответить
@AbdurRahman-mv4vz
@AbdurRahman-mv4vz - 09.07.2023 02:18

Thank you for the helpful video!

Ответить
@ethanrose4925
@ethanrose4925 - 27.06.2023 08:22

this was firee homie

Ответить
@elshroomness
@elshroomness - 15.06.2023 01:44

You should make another video explaining the merge sort psuedo code as well. The diagram helped me understand but the code at the end seemed a bit hand wavy for to me to understand.

Ответить
@user-mu7gw1uv1p
@user-mu7gw1uv1p - 13.06.2023 14:29

gracias bro

Ответить
@rudi8192
@rudi8192 - 09.06.2023 10:10

The algorithm is one thing. Implementing it c or other programming language is the real deal. When i first implemented it in university you call a function tha passes an array, the first index of the array 0 called min and the last index n-1 max. As long as min<max you calculate middle =(min+max)/2 and you call two consecutive margesort function passing A the array, min and middle fort the first
and A,middle+1,max for the second. The real deal is another function called marge that passes A,min,max,middle.

Ответить
@gabriel-oc4pt
@gabriel-oc4pt - 23.05.2023 02:17

Thank you!!!!!!!!!!!

Ответить
@lucutes2936
@lucutes2936 - 24.04.2023 19:28

thx

Ответить
@eventidewatcher
@eventidewatcher - 10.04.2023 04:47

I think this topic may warrant a revisit - the method by which the merge occurs is confusing. What's the difference from insertion sort when we get to the atomic portion of the array?

Ответить
@avtaras
@avtaras - 02.04.2023 13:25

Please do a video on Knuth-Morris-Pratt algorithm! 🙏🏼

Ответить
@jroseme
@jroseme - 29.03.2023 21:47

NOICE NOICE

Ответить
@NA-tk7ts
@NA-tk7ts - 03.03.2023 10:17

it is conquer and divide
u r wrong

Ответить
@j.a5051
@j.a5051 - 24.02.2023 08:43

Man, you summarize hours of lectures into clean, concise, easy to follow steps. Thank you.

Ответить
@JoseSanchez-ye3dn
@JoseSanchez-ye3dn - 21.12.2022 00:30

Why do I pay for University when I got this man wtf

Ответить
@nilsnachtigall363
@nilsnachtigall363 - 20.12.2022 19:35

what if the array has a length of 9? how does the splitting look like then

Ответить
@Nightmare78hAlo
@Nightmare78hAlo - 13.12.2022 21:04

What happens if you don't have the perfect amount to split ? Ie 11 elements in an array

Ответить
@tatalove241
@tatalove241 - 09.12.2022 13:10

Is this matlab??

Ответить
@chuck_norris
@chuck_norris - 08.12.2022 03:23

ok so in the 2nd part after the split up your Algorythm magically puts the elements into the right order??

Ответить
@tourajvaziri9840
@tourajvaziri9840 - 30.11.2022 10:34

Thanks very much again Michael. You are awesome!

Ответить
@CamFocusApp
@CamFocusApp - 17.11.2022 00:19

For people who didn't understand the merge part like I didn't when I watched this here's an explanation. when we finalize the divifing into smaller arrays part, we will have arrays from which we always know the smallest item, which is the left most. so we compare the left most item from each array and the smaller one we put it first into the bigger array. and we do that until we complete the bigger array.

Ответить
@XaxtonRevolution2
@XaxtonRevolution2 - 11.11.2022 15:25

how is this different from radix?

Ответить
@ibrahimfaiz501
@ibrahimfaiz501 - 09.11.2022 13:31

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

Ответить
@brobro6664
@brobro6664 - 01.11.2022 10:34

HAHAHAHAHAHAHAHAHAHAHAHHAAHAHAHAHAHAHHAHAH

Ответить
@sekhmet3770
@sekhmet3770 - 06.10.2022 06:09

thanks

Ответить
@cretudavid8622
@cretudavid8622 - 23.09.2022 07:54

So you divide, than you merge?

Ответить
@learnnepali6127
@learnnepali6127 - 20.08.2022 04:00

The merging part Itself needs to be more explained it seems a bit mysterious to me going from elements to a set of 4

Ответить
@this_is_mac
@this_is_mac - 18.07.2022 20:53

Dang it. You could've saved more time by speeding up the animation. Great content btw!

Ответить
@kundan24
@kundan24 - 16.07.2022 19:44

bad explanation. 👎👎
your animation is innacurate with the flow of code
shame

Ответить