-
Notifications
You must be signed in to change notification settings - Fork 4
/
array.html
155 lines (116 loc) · 8.68 KB
/
array.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
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
<!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">
<title>DSA VISUALIZATION </title>
<script src="https://cdn.tailwindcss.com"></script>
<!---------------------------TAILWIND ------------------------------------->
<script src="./js/tailwindConfig.js"></script>
<link rel="stylesheet" href="./style/style.css">
</head>
<body style="background-color:var(--primary);">
<div class="container-fluid">
<div class="flex flex-row">
<!------------------------------------------------ CONTROLLER AREA ------------------------------------------------------------------------------------>
<div class="flex-intial px-3" style="border-right: 1px solid grey; height: 100vh; width: 40%;">
<!-- This example requires Tailwind CSS v2.0+ -->
<div class="back-light py-3 px-20 my-5 rounded">
<h1 class="font-thin text-lg tracking-widest text-center">
<span>ARRAY</span>
</h1>
</div>
<section>
<nav>
<input id="toggle" style="border-radius:16px;" type="checkbox" checked>
<h2>SELECT DATA STRUCTURE</h2>
<ul>
<li> <a href="index.html">Home</a></li>
<li><a href="array.html">Array</a></li>
<li><a href="stack.html">Stack</a></li>
<li><a href="queue.html">Queue</a></li>
<li><a href="priorityqueue.html">Priority Queue</a></li>
<li><a href="singlylinklist.html">Singly Linked List</a></li>
<li><a href="doublylinklist.html">Doubly Linked List</a></li>
<li><a href="binary.html">Binary Search Tree</a></li>
<li><a href="search.html">Search Algorithms</a></li>
<li><a href="sort.html">Sort Algorithms</a></li>
</ul>
</nav>
<!------------------------------ SECTION THAT WILL BE CHANGED [CONTROLLER FOR EVERY DATASTRUCTURE] IN EVERY PAGE ------------------------------------------------------------------->
<div class="container hidden-scroll mx-2 font-sans">
<div class="flex flex-col" id="moreInfo">
<div class="mt-3 mr-4">
<button class="simulation">
Simulation Controls
</button>
<div class="simulationpanel w-700" id="simulationPanel">
<div class="grid grid-cols-2 gap-10 tracking-widest p-5">
<!-- INITIAL WORKS WILL BE ASSIGNED HERE -->
<button class="bg-secondary rounded hover:bg-primary20 duration-700 focus:shadow-outline" id="createBtn">CREATE ARRAY</button>
<input type="number" id="arrayLength" class="text-center" placeholder="LENGTH">
<button class="bg-secondary rounded hover:bg-primary20 duration-700 focus:shadow-outline" id="insertBtn">INSERT</button>
<div class="grid grid-cols-2 gap-5 tracking-widest" >
<input type="number" id="insertData" class="text-center" placeholder=" VALUE">
<input type="number" id="index" class="text-center" placeholder="INDEX">
</div>
<button class="bg-secondary rounded hover:bg-primary20 duration-700 focus:shadow-outline" id="deleteBtn">DELETE</button>
<div class="grid grid-cols-2 gap-5 tracking-widest" >
<input type="number" id="delIndex" class="text-center" placeholder="INDEX">
<input type="number" id="delValue" class="text-center" placeholder="VALUE">
</div>
<!-- REPlace Value-->
<button class="bg-secondary rounded hover:bg-primary20 duration-700 focus:shadow-outline" id="replaceBtn">REPLACE</button>
<div class="grid grid-cols-2 gap-5 tracking-widest" >
<input type="number" id="replaceIndex" class="text-center" placeholder="INDEX">
<input type="number" id="replaceValue" class="text-center" placeholder="VALUE">
</div>
<button class="bg-secondary rounded hover:bg-primary20 duration-700" id="searchBtn">SEARCH</button>
<input type="number" id="search" class="text-center" placeholder="VALUE">
<button class="bg-secondary text-red-600 rounded hover:bg-primary20 duration-700" id="reverseBtn">REVERSE</button>
<button class="bg-secondary text-red-600 rounded hover:bg-primary20 duration-700" id="randomBtn" >RANDOM ARRAY</button>
<button class="bg-secondary text-red-600 rounded hover:bg-primary20 duration-700" id="resetBtn" >RESET</button>
</div>
</div>
<div id="queueinfo" class="alert items-center" style="display: none; background: coral">
<span class="closebtn" onclick="this.parentElement.style.display='none';">×</span>
<p></p>
</div>
<button class="accordion" onclick="sortedPriorityQueue.isSorted=false;">
Array
</button>
<div class="panel ">
<p class="py-4">
An Array is a data structure that contains a group of elements. Typically these elements are all of the same data type, such as an integer or string. Arrays are commonly used in computer programs to organize data so that a related set of values can be easily sorted or searched.
</p>
<br>
<p>
Time complexity :
<br>Insertion : O(n)
<br>Deletion : O(n)
<br>Replace : O(1)
<br>Search : O(n)
<br>Reverse : O(n)
</p>
<br>
</div>
</div>
</div>
</div>
</section>
</div>
<!--------------------------------------------------------- PLAYGROUND AREAD ------------------------------------------------------------------------------------------------>
<div class="container h-screen back-dark" style="height:100vh; width: 60%;">
<div class="text-center border m-10 border-pink p-3 text-lg text-pink" id="error" style="display : none"> NULL VALUE CANNOT BE PUSHED </div>
<div class="flex flex-row flex-wrap m-10 items-center" id="animation-container"></div>
<div class="text-center border border-pink m-10 p-3 text-lg text-pink" id="reverse" style="display : none"> NULL VALUE CANNOT BE PUSHED </div>
<div class="flex flex-row flex-wrap items-center m-10" id="animation-container2"></div>
</div>
<!--------------------------------------------------------- PLAYGROUND AREA ENDS ------------------------------------------------------------------------------------------------>
</div>
</div>
</body>
<!-- PAGE SPECIFICE ANIMATIION -->
<script defer type="module" src="./js/datastructureControllers/array.js"></script>
</html>