0% found this document useful (0 votes)
74 views13 pages

Merge Sort

The document explains how to sort an array using merge sort. It involves 3 steps: 1. Divide the array into two equal parts. 2. Recursively sort both parts. 3. Merge the two sorted parts back into one fully sorted array. The document provides pseudocode for merging two sorted arrays into a single sorted array. It also discusses analyzing the time complexity of merge sort, which is O(n log n).

Uploaded by

Shubham Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views13 pages

Merge Sort

The document explains how to sort an array using merge sort. It involves 3 steps: 1. Divide the array into two equal parts. 2. Recursively sort both parts. 3. Merge the two sorted parts back into one fully sorted array. The document provides pseudocode for merging two sorted arrays into a single sorted array. It also discusses analyzing the time complexity of merge sort, which is O(n log n).

Uploaded by

Shubham Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

£39 12,3£

f is
.

¥¥ ¥¥QC
[ Iffy sorted →
.

nurse .

[ 3,4,
S
,
6
,
8
,
]
12
① Divide array
into 2 parts .

② Get both parte sorted via recursion .

③ to sorted
merge parts
}*¥4
.

Explains
:
ice :[
¥4 ¥] ?
)
i@ =
[
sire
[
Carlton
3.195,618,919,327g

go
?⃝
8#5↳⇐)③ say
✓ ↳ q

É;Ip 1*9*9
" '

. .
?⃝
[email protected]
3
(¥ ↳ \
[1,2/3]
z, I
y
e

ftp.f.FM?.I...,
,

f¥¥¥
☒ N

as
IF Fa -
E+E=w
as his
☒ ☒ = #
Ein
1
'

:
: i
'

☐ ☐ ☐ '
* n
-

N
:
-
* FAT every
devil ,
N elements are bugs merged .

÷
=

↳ E- %
☐ -

↳ I

E.
=

%
:
☐ i=÷
.

I
Nz I
=
= N

K log 2 =
login

k=log
:O(N*log①
-
spam coupon
Am a

%)
?⃝
1- ( ) n = 1- (
Nz ) + 1-
(E) + d- Y
=
2T
(Nz ) + ( N 1) -

tap
It
,
2 ✗ = I

÷
-

Tina • + a

fan -

f :-.
fn 2dm
-

log u -
?⃝
"

logn
'

# u
=

"

( gut
:-|
=

,
=

legn ta
+ -
l

= at
nflogn +

at
-

1)
Int nlogn
?
=
'
+
=
0k10g a) or
0(⇐g①
Aki

¥÷Éi
t.ES
✓ →
( am
,

s*→#nm [ ( am
,
m
, e)
?⃝
(
.me
am
,
S, m
,
e.)
for / ik= kclenlmixittt) / mix =

42,34$
am
[ stk) = mix [ ]
k

2
§ 4

☒¥É÷j
3 4 3 2 I

÷
, , sit

• * ✗ a .

a
ahead -
-
I °
.
'

am
[3+1]=2
C.EE#@@@

You might also like