-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
164 lines (139 loc) · 9.12 KB
/
Copy pathindex.html
File metadata and controls
164 lines (139 loc) · 9.12 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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&family=Press+Start+2P&family=Russo+One&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&family=Press+Start+2P&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<title>Sorting Visualizer</title>
<body background="">
<div class="container">
<br>
<h1 class="heading text-center" style="font-family: 'Russo One', sans-serif; color: rgb(219, 219, 219); ">Sorting Algorithm Visualizer<br><br>
<i><p class="text-center">"An Algorithm must be seen to be believed"<br><p class="text-center">- Donald Knuth</p> </p></i>
</h1><br>
<div class=" display-inline box" style="color: aliceblue; font-family: 'Poppins', sans-serif;padding: 15px;">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<select class="form-select" style="width: 400px;" name="algo" id="sortingAlgo">
<option value="insertion">Select Sorting Algorithm to Visualize!</option>
<option value="insertion">Insertion Sort</option>
<option value="selection">Selection Sort</option>
<option value="bubble">Bubble Sort</option>
<option value="bubble">Quick Sort</option>
<option value="bubble">Merge Sort</option>
</select>
</div>
<br>
<div class="input-group mb-3">
<input type="text" id="array" placeholder="Enter Space Separated Array" class="form-control"
aria-label="Default" aria-describedby="inputGroup-sizing-default">
</div>
<button onclick="generateArray()" class="btn btn-outline-primary">Generate random array</button>
<button onclick="validate()" type="button" class="btn btn-dark">Start Sorting</button>
</div>
<br><br>
<div class="text-center">
<div class="card">
<div class="card-header" >
Simulation
</div>
<div>
<div class="numbers">
</div>
</div>
</div>
</div>
<div data-aos="fade-left" data-aos-duration="1500" class="skills">
<div class="programming"><br>
<h1 style="font-family: 'Russo One', sans-serif;">Sort Algorithm</h1><br><br>
<p>Sorting Algorithms are used to sort a data structure according to a specific order relationship, such as numerical order or lexicographical order.<br><br>
This operation is one of the most important and widespread in computer science. For a long time, new methods have been developed to make this procedure faster and faster.<br><br>
There are currently hundreds of different sorting algorithms, each with its own specific characteristics. They are classified according to two metrics: space complexity and time complexity.<br><br>
Those two kinds of complexity are represented with asymptotic notations, mainly with the symbols O, Θ, Ω, representing respectively the upper bound, the tight bound, and the lower bound of the algorithm's complexity, specifying in brackets an expression in terms of n, the number of the elements of the data structure.<br><br>
Most of them fall into two categories:<br><br>
<u style="font-size: 35px;">Logarithmic</u><br>
The complexity is proportional to the binary logarithm (i.e to the base 2) of n.
An example of a logarithmic sorting algorithm is Quick sort, with space and time complexity O(n × log n).<br><br>
- Quick Sort<br>
- Merge Sort<br>
- Heap Sort<br><br>
<u style="font-size: 35px;">Quadratic</u><br>
The complexity is proportional to the square of n.
An example of a quadratic sorting algorithm is Bubble sort, with a time complexity of O(n2).
Space and time complexity can also be further subdivided into 3 different cases: best case, average case and worst case.<br><br>
- Bubble Sort<br>
- Selection Sort<br>
- Insertion Sort<br>
- Gnome Sort<br>
- Shaker Sort<br>
- OddEven Sort<br>
- Pancake Sort<br><br>
Have Fun!</p><br><br>
</div>
</div>
<section class="s1">
<div class="main-container"><br>
<div data-aos="zoom-in" data-aos-duration="1500" class="post-wrapper">
<div class="post">
<img class="thumbnail" src="textures/bubble.jpg">
<div class="post-preview">
<h6 class="post-title">Description</h6><br>
<p class="post-intro"> Bubble Sort is an iterative sorting algorithm that imitates the movement of bubbles in sparkling water..<br><br>
Complexity:
<br>
<b>Average Complexity:</b> O(n<sup>2</sup>)<br>
<b>Best Case:</b> O(n)<br>
<b>Worst Case:</b> O(n<sup>2</sup>)<br>
<b>Space Complexity: </b>O(1)<br><br><br>
</p>
</div>
</div>
<div class="post">
<img class="thumbnail" src="textures/selection.jpg">
<div class="post-preview">
<h6 class="post-title"><b>Description</b></h6><br>
<p class="post-intro">The selection sort algorithm sorts an array by repeatedly finding the minimum element from unsorted part and putting it at the beginning. <br><br>
Complexity:<br>
<b>Average Complexity:</b> O(n<sup>2</sup>)<br>
<b>Best Case:</b> O(n<sup>2</sup>)<br>
<b>Worst Case:</b> O(n<sup>2</sup>)<br>
<b>Space Complexity: </b>O(1)<br>
</p>
</div>
</div>
<div class="post">
<img class="thumbnail" src="textures/insertion.jpg">
<div class="post-preview">
<h6 class="post-title">Description</h6><br>
<p class="post-intro">The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part.<br><br>
Complexity:<br>
<b>Average Complexity:</b> O(n<sup>2</sup>)<br>
<b>Best Case:</b> O(n)<br>
<b>Worst Case:</b> O(n<sup>2</sup>)<br>
<b>Space Complexity: </b>O(1)<br>
</p>
</div>
</div>
</div>
<h1 style="font-family: 'Russo One', sans-serif; text-align: center; color: aliceblue;">Thank you for visiting</h1>
</div>
</section>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js" integrity="sha512-dLxUelApnYxpLt6K2iomGngnHO83iUvZytA3YjDUCjT0HDOHKXnVYdf3hU4JjM8uEhxf9nD1/ey98U3t2vZ0qQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<!-- <script>
AOS.init();
</script> -->
<script src="drawing.js"></script>
<!-- <script src="main.js"> -->
</script>
<script src="sorting.js"></script>
<script src="algos.js"></script><br>
<p style="text-align: center; color: #ccd6f6; font-family: 'Roboto Mono', monospace;font-size: large;">
Design with ❤️ by <a href="https://www.linkedin.com/in/suchit-negi-5246a0170/">Suchit Negi</a><br> All Rights Reserved
</p>
</body>
</html>