Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
170 lines (113 loc) · 3.15 KB
/
Copy pathindex.html
File metadata and controls
170 lines (113 loc) · 3.15 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sorting Visualizer-By Sheikh Hajrat</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- HEADER -->
<header>
<h1>Sorting Visualizer</h1>
<p>Visualize popular sorting algorithms</p>
</header>
<!-- CONTROLS -->
<section class="controls">
<div class="control">
<label for="algorithm">
Algorithm
</label>
<select id="algorithm">
<option value="bubble">
Bubble Sort
</option>
<option value="selection">
Selection Sort
</option>
<option value="insertion">
Insertion Sort
</option>
<option value="merge">
Merge Sort
</option>
<option value="quick">
Quick Sort
</option>
<option value="heap">
Heap Sort
</option>
</select>
</div>
<div class="control">
<label for="size">
Array Size:
<span id="sizeValue">40</span>
</label>
<input type="range" id="size" min="10" max="100" value="40">
</div>
<div class="control">
<label for="speed">
Speed:
<span id="speedValue">50</span>
</label>
<input type="range" id="speed" min="1" max="100" value="50">
</div>
<button id="generateBtn">
Generate Array
</button>
<button id="sortBtn">
Start Sorting
</button>
</section>
<!-- STATISTICS -->
<section class="statistics">
<div class="stat">
<span>Comparisons</span>
<strong id="comparisons">
0
</strong>
</div>
<div class="stat">
<span>Swaps</span>
<strong id="swaps">
0
</strong>
</div>
<div class="stat">
<span>Status</span>
<strong id="status">
Ready
</strong>
</div>
</section>
<!-- VISUALIZER -->
<main>
<div id="arrayContainer"></div>
</main>
<!-- LEGEND -->
<section class="legend">
<div>
<span class="legendBar normal"></span>
Unsorted
</div>
<div>
<span class="legendBar comparing"></span>
Comparing
</div>
<div>
<span class="legendBar swapping"></span>
Swapping
</div>
<div>
<span class="legendBar sorted"></span>
Sorted
</div>
</section>
<footer>
Sorting Visualizer By <a href="https://www.instagram.com/sheikh_hajrat10">Sheikh Hajrat</a>
</footer>
<!-- JAVASCRIPT -->
<script src="script.js"></script>
</body>
</html>