-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml.html
More file actions
65 lines (55 loc) · 2.52 KB
/
html.html
File metadata and controls
65 lines (55 loc) · 2.52 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Compare Sorting Algorithms</title>
<link rel="stylesheet" href="css.css">
</head>
<body>
<h1 class="header">Sorting Algorithm Information</h1>
<div class="results">
<h2>Comparisons</h2>
<p>Select two algorithms and click compare to see details.</p>
<div class="result-card">
<h3>Bubble Sort</h3>
<p><strong>Time Complexity:</strong> O(n²)</p>
<p><strong>Space Complexity:</strong> O(1)</p>
<p><strong>Best Use Case:</strong> Educational purposes and small datasets where simplicity is preferred
(Arranging Books by Height)</p>
</div>
<div class="result-card">
<h3>Selection Sort</h3>
<p><strong>Time Complexity:</strong> O(n²)</p>
<p><strong>Space Complexity:</strong> O(1)</p>
<p><strong>Best Use Case:</strong> Environments like flash memory where reducing the number of write
operations is more important than speed (Simple comparison & Memory writes)</p>
</div>
<div class="result-card">
<h3>Insertion Sort</h3>
<p><strong>Time Complexity:</strong> O(n²) | Best: O(n)</p>
<p><strong>Space Complexity:</strong> O(1)</p>
<p><strong>Best Use Case:</strong> Sorting a hand of playing cards according to the numbers and colors</p>
</div>
<div class="result-card">
<h3>Merge Sort</h3>
<p><strong>Time Complexity:</strong> O(n log n)</p>
<p><strong>Space Complexity:</strong> O(n)</p>
<p><strong>Best Use Case:</strong> Sorting linked lists or large datasets with guaranteed performance
(Sorting large lists)</p>
</div>
<div class="result-card">
<h3>Quick Sort</h3>
<p><strong>Time Complexity:</strong> O(n log n) | Worst: O(n²)</p>
<p><strong>Space Complexity:</strong> O(log n)</p>
<p><strong>Best Use Case:</strong> In computer graphics, QuickSort is used for image rendering </p>
</div>
<div class="result-card">
<h3>Heap Sort</h3>
<p><strong>Time Complexity:</strong> O(n log n)</p>
<p><strong>Space Complexity:</strong> O(1)</p>
<p><strong>Best Use Case:</strong> Situations requiring guaranteed O(n log n) performance without recursion
like (Traffic management systems)</p>
</div>
</div>
</body>
</html>