Chinês Insertion Sort

Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 6

Tempo

10.000

Insertion Sort

00:13:864 seg

Selection Sort

00:19:208 seg

Buble Sort

00:02:788 seg

Merge Sort

02:06:152 seg

Quick Sort

00:13:690 seg

Chins
Insertion Sort
a= [1,4,6,8,9,3,5,7,0,2]
i= 0 / j= 8 / k= 0 / min= 0
a= [ 0,4,6,8,9,3,5,7,1,2]
i= 1 / j= 5 / k= 1 / min=3 / t= 0
a= [0,4,6,8,9,3,5,7,1,2]
i= 1 / j= 8 / k= 5 / min= 1 / t= 0
a= [0,1,6,8,9,3,5,7,4,2]
i= 2 / j= 5 / k= 2 / min= 3 / t= 1
a= [0,1,6,8,9,3,5,7,4,2]
i= 2 / j= 9 / k= 5 / min= 2 / t= 1
a= [0,1,2,8,9,3,5,7,4,6]
i= 3 / j= 5 / k= 3 / min= 3 / t= 2
a= [0,1,2,3,9,8,5,7,4,6]
i= 4 / j= 5 / k= 4 / min= 8 / t= 3
a= [0,1,2,3,9,8,5,7,4,6]
i= 4 / j= 6 / k= 5 /min= 5 / t= 3
a= [0,1,2,3,4,8,5,7,4,6]
i= 4 / j= 8 / k= 6 / min= 4 / t= 3
a= [0,1,2,3,4,8,5,7,9,6]
i= 5 / j= 6 / k= 5 / min= 5 / t= 4
a=[ 0,1,2,3,4,5,8,7,9,6]
i= 6 / j= 7 / k= 6 / min= 7 / t= 5
a= [0,1,2,3,4,5,8,7,9,6]
i= 6 / j= 9 / k= 7 /min= 6 / t= 5
a= [0,1,2,3,4,5,6,7,9,8]
i= 8/ j= 9 / k= 8 / min= 8 / t= 1

Selection Sort
a= [3,1,6,8,4,0,2,5,9,7]
i= 0 / m= 5 / min= 0
a= [0,1,6,8,4,3,2,5,9,7]
i= 1 / m= 0 / min= 1
a= [0,1,2,8,4,3,6,5,9,7]
i= 2 / m= 1 / min= 2
a= [0,1,2,3,4,8,6,5,9,7]
i= 3 / m= 2 / min= 3
a= [0,1,2,3,4,8,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,8,9]
i= 5 / t= 4 / F
a= [2,0,1,3,4,5,6,7,8,9]
i= 6 / t= 4 / F
a= [2,0,1,3,4,5,6,7,8,9]
i= 7 / t= 4 / F
a= [2,0,1,3,4,5,6,7,8,9]
i= 8 / t= 4 / F
a= [2,0,1,3,4,5,6,7,8,9]
i= 9 / t= 4 / F
a= [2,0,1,3,4,5,6,7,8,9]
i= 1 / t= 4 / T
a= [0,2,1,3,4,5,6,7,8,9]
i= 2 / t= 2 / F
a= [0,1,2,3,4,5,6,7,8,9]
i= 3 / t= 2 / F

Quick Sort
Greater

Lesser

Lista

Pivots

[ ]

[ ]

[1]

[1]

[1]

[ ]

[ 0,1 ]

[0]

[ ]

[ ]

[6]

[6]

[ ]

[5,6]

[ 5,6 ]

[ ]

[4,5,6

4,5,6

[ ]

[3,4,5,6

[ ]

[ ]

[9]

[9]

[ ]

[8,9

[8]

8,9

3,4,5,6

[7,3,4,5,8,9,6

[7]

3,4,5,6,7,8,9

[ 0,1 ]

[2,7,3,0,4,1,5,8,9,6

[ ]

[ ]

[1]

[ ]

0,1

[ ]

[ ]

[6]

[6]

[6]

[ ]

[ 5,6 ]

[5]

5,6

[ ]

[ 4,5,6 ]

[4]

[ ]

[ ]

[9]

[9]

[9]

[ ]

[ 8,9 ]

[8]

[ 8,9 ]

3,4,5,6

[7,3,4,5,8,9,6

3,4,5,6,7,8,9

0,1

[2,7,3,0,4,1,5,8,9,6

[2]

3,4,5,6,7,8,9

[ 0,1 ]

[2,7,3,0,4,1,5,8,9,6

Print lesser + pivots + greater = [0,1,2,3,4,5,6,7,8,9]

You might also like