-
Notifications
You must be signed in to change notification settings - Fork 0
/
heapSort.html
112 lines (109 loc) · 5.93 KB
/
heapSort.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous">
</script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://kit.fontawesome.com/00a4711f34.js" crossorigin="anonymous"></script>
<!-- -->
<link rel="stylesheet" type="text/css" href="style.css">
<!-- -->
<script src="HeapSort.js"></script>
<title>Heap Sort</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-dark d-flex align-items-center">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id='navbarSupportedContent'>
<ul class='navbar-nav mr-auto'>
<li class='nav-item'><a class="navbar-brand text-white pr-2" href="#"
onclick="window.open('bubbleSort.html','_self');">Bubble Sort</a></li>
<li class='nav-item'><a class="navbar-brand text-white pr-2" href="#"
onclick="window.open('quickSort.html','_self');">Quick Sort</a></li>
<li class='nav-item'><a class="navbar-brand text-white pr-2" href="#"
onclick="window.open('heapSort.html','_self');">Heap Sort</a></li>
<li class='nav-item'><a class="navbar-brand text-white pr-2" href="#"
onclick="window.open('insertionSort.html','_self');">Insertion Sort</a></li>
<li class='nav-item'><a class="navbar-brand text-white pr-2" href="#"
onclick="window.open('shellSort.html','_self');">Shell Sort</a></li>
</ul>
<button type="button" class="btn btn-primary ml-4" onclick='limparRelatorio();'>Limpar
relatório</button>
</div>
</nav>
<div class='micro'>
<div class='container-fluid'>
<div class='row'>
<div class='col-sm-2'>
<div class='overflow'>
<table class="table table-borderless" id='tabelaRandomMicro'>
<thead>
<tr>
<th scope="col">Qtd</th>
<th scope="col">Números</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class='col-sm-2'>
<div class='overflow'>
<table class="table table-borderless" style='width:200px' id='tabelaOrdenadaMicro'>
<thead id='headFixed'>
<tr>
<th>Qtd</th>
<th>Ordenados</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class='col mt-3'>
<div class='row'>
<div class='col-sm-4'>
<input type="text" class="form-control" id='numero' placeholder="Números">
</div>
<div class='col-sm-2'>
<button type="button" class="btn btn-primary" onclick='criaNumero();'>Criar
Lista</button>
</div>
<div class='col-sm-2 offset-md-2' id='botaoOrdena'>
<button type="button" class="btn btn-primary ml-4" onclick='heapSort(shuffledArray);'>Ordenar
Lista</button>
</div>
</div>
<div class='row'>
<div class='col mt-5' style='font-family:candara;font-size:16px'>
<b>Tem um desempenho em tempo de execução muito bom em conjuntos ordenados aleatoriamente, tem um uso de memória bem comportado e o seu desempenho em pior cenário é praticamente igual ao desempenho em cenário médio. Alguns algoritmos de ordenação rápidos têm desempenhos espetacularmente ruins no pior cenário, quer em tempo de execução, quer no uso da memória.
Dessa forma, o tempo de ordenação é quase linear com o número de itens a ordenar.
</b>
</div>
</div>
<div class='row'>
<div class='col mt-5'>
<img style="-webkit-user-select: none;margin: auto;background-color: hsl(0, 0%, 90%);transition: background-color 300ms;" src="https://upload.wikimedia.org/wikipedia/commons/1/1b/Sorting_heapsort_anim.gif">
</div>
</div>
</div>
<div class='col-md-4 ml-5'>
<p id='relatorio'></p>
</div>
</div>
</div>
</div>
</body>
</html>