Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Samenvatting

Summary Merge Sort

Beoordeling
-
Verkocht
-
Pagina's
2
Geüpload op
25-03-2023
Geschreven in
2022/2023

Merge sort is explained

Instelling
Vak

Voorbeeld van de inhoud

Mergesort is a sorting technique also works on divide and conquer
technique as in quicksort technique. In this video I discuss with you
the working of this merge sort with help of an example. The first
step is dividing the given list into sub lists and the second step is
merging of those sub lists. C merge sort is a function merge suit is
array we are going to pass lower bound and upper bound this is
lower bound. If two elements are there then then you're going to
divide that particular list into sub lists. Then each each sub list is
having only one element and that is the condition you have to stop
dividing you will keep on dividing the sub list. The main thing is you
have to write down the code for this merge function that this
backbone of the merge function how we are going to merge these
arrays. The code is a recursion call to left part n to right part so this
is a call to a recursively call.

Midpoint is midpoint fine so here we call merge sort 0 - middle
element is 0 because 0 plus 1 that is 1 1 divided by 2 is 0 and then
again merge sort 1 to 1 and again we are going to call merge
methadone 0 metal point is lower bound is 0. This is the recursive
tree now how this is going to be called see first of all massive of 0 to
8 here we have first cold would we do this function 0 to 4 again for
first sorting of this one. We are going to call merge 5 then 5 and
then 6 fine lower bound is 5 mid is also 5 and upper bound is six
now seven 8 7 is less than this it yes this condition is true. We are
going to merge these list with its adjacent lest only and when you're
going to draw this recursion tree then you come to know that how
we are. merging these sub lists will be merged this and this that is
why I am saying you can not merge this 15 with 8 or 15 with 24 but
it 's not like that if this 5 and 15 is 1 list and you are merging this
with 8 no.

I am going to discuss with you how this merge function is going to
be executed. We are going to compare the first element of these
sub lists fifteen and five which one is less five is less. then here six
to six then merging would be done then again back to seven to
eight then this one this one and then finally merging of these lists
fine. Time complexity for this merging function would be what theta
M plus in M is number of elements in one sorted sub list and is
number in another sorted sub lists. When you are going to add these
elements into this one then how many elements would be there in
this key in this sub list M plus n. If you write down the code for this

Geschreven voor

Vak

Documentinformatie

Geüpload op
25 maart 2023
Aantal pagina's
2
Geschreven in
2022/2023
Type
SAMENVATTING

Onderwerpen

€5,42
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
anishk

Maak kennis met de verkoper

Seller avatar
anishk Manipal Univeraity
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
3 jaar
Aantal volgers
0
Documenten
1
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen