-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
26 lines (22 loc) · 1.29 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
</head>
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div id='doc'>
<p>This is a visualization intended to illustrate a BFS solution of the perfect square problem on Leetcode. Following is the link to the problem and the BFS solution.</p>
<a href="https://leetcode.com/problems/perfect-squares/" target="_blank">Perfect Squares Problem</a>
<br>
<a href="https://discuss.leetcode.com/topic/24255/summary-of-4-different-solutions-bfs-dp-static-dp-and-mathematics" target="_blank">BFS Solution</a>
</div>
<br>
<div id="vis">
<p id='comment'>Input a number to start the animation. A queue is used to go through the BSF tree. Nodes are colored green when they are added in the queue. They become white after being pushed out from the queue. After the animation, hovering over each node will show the path to the root node and a tooltip with the squares associated with the current node.</p>
<input id='inputValue' type="text" placeholder="input number" onchange="start(this.value)">
<svg id='svg'></svg>
</div>
<div id="tooltip" class="hidden">
<p><span id="tooltip-text"></span></p>
</div>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="js/main.js"></script>
</body>