Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
116 lines (104 loc) · 3.55 KB
/
Copy pathindex.html
File metadata and controls
116 lines (104 loc) · 3.55 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Take Off Labs Test</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!--FIRST EXERCISE-->
<div class="container">
<h2>1. Rotate a N by N array by 90 degrees.</h2>
<p><em>
We will assume that `N` is bigger then 2 and less then 100.
</em></p>
<div>
<input type="number"
name="matrixSize"
id="matrixSize"
class="customInputs"
placeholder="Please entre the matrix size">
</div>
<div>
<button class="btn btn-create" onclick="createMatrix()">
Create Array
</button>
<button class="btn btn-calculate" onclick="rotateCreatedMatrix(true)">
Rotate clockwise
</button>
<button class="btn btn-search" onclick="rotateCreatedMatrix(false)">
Rotate anticlockwise
</button>
</div>
<div>
<table>
<tbody id="originalMatrix">
</tbody>
</table>
</div>
<div>
<table>
<tbody id="rotatedMatrix">
</tbody>
</table>
</div>
</div>
<!--SECOND EXERCISE-->
<div class="container">
<h2>
2. Given an array that is sorted, but rotated to the right by an unknown number of times. Find the position
of an element.
</h2>
<p><em>
We will assume that we have an array, and it's values are integers and it is sorted ascended,
then rotated x number of times, clockwise.
</em></p>
<form id="arrayForm" name="arrayForm" onsubmit="validateForm(this)">
<div>
<input class="customInputs"
type="number"
name="arrayStart"
id="arrayStart"
placeholder="Enter array start value">
<input class="customInputs"
type="number"
name="arrayEnd"
id="arrayEnd"
placeholder="Enter array end value">
<input class="customInputs"
type="number"
name="arrayStep"
id="arrayStep"
placeholder="Enter array steps size">
</div>
<div>
<button class="btn btn-create"
type="submit">
Generate Array
</button>
<button class="btn btn-calculate"
onclick="rotateRandomNr()"
type="button">
Rotate and show result
</button>
<button class="btn btn-search"
type="button"
onclick="openFindElement()">
Find Element
</button>
<p id="resultOfSearch"></p>
</div>
</form>
<div>
<p><b>Original Array:</b> <span id="originalArray"></span></p>
</div>
<div>
<p><b>Rotated Array:</b> <span id="rotatedArray"></span></p>
</div>
</div>
<script src="rotateMatrixScript.js"></script>
<script src="findElemetInRotatedArrayScript.js"></script>
<footer>Denisa Lavinia Profir - 2017</footer>
</body>
</html>
<!--Denisa Lavinia Profir - 2017.11.05-->