-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
187 lines (183 loc) · 9.68 KB
/
index.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Data Structures 2D Array</title>
<link rel="stylesheet" href="./css/styles.css">
</head>
<body>
<div class="container">
<div style="width: 100%;float: left;">
<h1 class="text-center">Data Structures Array 2D</h1>
<h4>Array 1</h4>
<div id="box-container">
</div>
<div class="mt-10">
<div class="display-inline f-l">
<button onclick="insertIntoArray(0)">Insert Row</button>
<button onclick="showToggler('create-box')">Create Array</button>
<button onclick="showToggler('update-box')">Update</button>
<button onclick="showToggler('delete-box')">Delete</button>
<button onclick="showToggler('search-box')">Find</button>
<button onclick="rotateLeft(0)">Rotate Left</button>
<button onclick="rotateRight(0)">Rotate Right</button>
<button onclick="showToggler('swap-row-box')">Swap Row</button>
<button onclick="showToggler('swap-col-box')">Swap Col</button>
<div class="mt-10" id="update-box" style="display: none;">
<input type="number" name="upd-row" placeholder="row" id="upd-row" class="w-70">
<input type="number" name="upd-col" placeholder="col" id="upd-col" class="w-70">
<input type="number" name="upd-col" placeholder="number" id="upd-num" class="w-70">
<br>
<button class="mt-10" onclick="updateArray(0,'upd')">Save</button>
</div>
<div class="mt-10" id="create-box" style="display: none;">
<input type="number" name="rows" placeholder="rows" id="create-row" class="w-70">
<input type="number" name="col" placeholder="cols" id="create-col" class="w-70">
<br>
<button class="mt-10" onclick="createArray(0)">Create</button>
</div>
<div class="mt-10" id="swap-row-box" style="display: none;">
<input type="number" name="row" placeholder="row # 1" id="swap-row1" class="w-70"> by
<input type="number" name="col" placeholder="row # 2" id="swap-row2" class="w-70">
<br>
<button class="mt-10" onclick="swapRow(0,'swap')">Swap</button>
</div>
<div class="mt-10" id="swap-col-box" style="display: none;">
<input type="number" name="swap-col-r1" placeholder="row # 1" id="swap-col-r1" class="w-70">
<input type="number" name="swap-col-c1" placeholder="col # 1" id="swap-col-c1" class="w-70"> by
<input type="number" name="swap-col-r2" placeholder="row # 2" id="swap-col-r2" class="w-70">
<input type="number" name="swap-col-c2" placeholder="col # 2" id="swap-col-c2" class="w-70">
<br>
<button class="mt-10" onclick="swapCol(0,'swapRow')">Swap</button>
</div>
<div class="mt-10" id="delete-box" style="display: none;">
<input type="number" name="row" placeholder="row" id="dlt-row" class="w-70">
<input type="number" name="col" placeholder="col" id="dlt-col" class="w-70">
<br>
<button class="mt-10" onclick="deleteFromArray(0, 'dlt')">Save</button>
</div>
<div class="mt-10" id="search-box" style="display: none;">
<input type="number" name="index" placeholder="row" id="srch-row" class="w-70">
<input type="number" name="index" placeholder="col" id="srch-col" class="w-70">
<br>
<button class="mt-10" onclick="searchInArray(0,'srch')">Search</button>
</div>
</div>
<div class="display-inline f-r">
<h2>Statistics</h2>
<table id="t-main">
<tr>
<th>State</th>
<th>Numbers</th>
</tr>
<tr>
<td>Size</td>
<td><span id="arrayLength"></span></td>
</tr>
<tr>
<td>IsEmpty</td>
<td><span id="isArrayEmpty"></span></td>
</tr>
<tr>
<td>Type</td>
<td><span id="arrtype"></span></td>
</tr>
<tr>
<td>IsIdentity Matrix</td>
<td><span id="isIdentical"></span></td>
</tr>
<tr>
<td>IsZero Matrix</td>
<td><span id="IsZero"></span></td>
</tr>
<tr>
<td>Add to Array 2</td>
<td><span id="IsAddible"></span></td>
</tr>
<tr>
<td>Multiplication to Array 2</td>
<td><span id="IsMultiplicable"></span></td>
</tr>
<tr>
<td>Subtraction to Array 2</td>
<td><span id="IsSubtractable"></span></td>
</tr>
</table>
</div>
</div>
</div>
<br>
<div>
<h4>Array 2</h4>
<div id="box-container1">
</div>
<div class="mt-10">
<div class="display-inline f-l">
<button onclick="insertIntoArray(1)">Insert</button>
<button onclick="showToggler('create-box1')">Create Array</button>
<button onclick="showToggler('update-box1')">Update</button>
<button onclick="showToggler('delete-box1')">Delete</button>
<button onclick="showToggler('search-box1')">Linear Search</button>
<div class="mt-10" id="update-box1" style="display: none;">
<input type="number" name="upd-row" placeholder="row" id="upd-row1" class="w-70">
<input type="number" name="upd-col" placeholder="col" id="upd-col1" class="w-70">
<input type="number" name="upd-col" placeholder="number" id="upd-num1" class="w-70">
<br>
<button class="mt-10" onclick="updateArray(1,'upd')">Save</button>
</div>
<div class="mt-10" id="create-box1" style="display: none;">
<input type="number" name="rows" placeholder="rows" id="create-row1" class="w-70">
<input type="number" name="rows" placeholder="cols" id="create-col1" class="w-70">
<br>
<button class="mt-10" onclick="createArray(1)">Create</button>
</div>
<div class="mt-10" id="delete-box1" style="display: none;">
<input type="number" name="row" placeholder="row" id="dlt-row1" class="w-70">
<input type="number" name="col" placeholder="col" id="dlt-col1" class="w-70">
<br>
<button class="mt-10" onclick="deleteFromArray(1, 'dlt')">Save</button>
</div>
<div class="mt-10" id="search-box1" style="display: none;">
<input type="number" name="index" placeholder="row" id="srch-row1" class="w-70">
<input type="number" name="index" placeholder="col" id="srch-col1" class="w-70">
<br>
<button class="mt-10" onclick="searchInArray(1,'srch')">Search</button>
</div>
</div>
<div class="display-inline f-r ">
<h2>Statistics</h2>
<table id="t-main">
<tr>
<th>State</th>
<th>Numbers</th>
</tr>
<tr>
<td>Size</td>
<td><span id="arrayLength1"></span></td>
</tr>
<tr>
<td>IsEmpty</td>
<td><span id="isArrayEmpty1"></span></td>
</tr>
<tr>
<td>Type</td>
<td><span id="arrtype1"></span></td>
</tr>
<tr>
<td>IsIdentity</td>
<td><span id="isIdentical1"></span></td>
</tr>
<tr>
<td>IsZero Matrix</td>
<td><span id="IsZero1"></span></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<script src="./index.js"></script>
</body>
</html>