2023-09-09 15:49:53 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2023-09-19 09:00:25 +00:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>CDN Test</title>
|
2023-09-21 16:53:34 +00:00
|
|
|
<script src="https://cdn.jsdelivr.net/npm/data-structure-typed/umd/bundle.min.js"></script>
|
2023-09-09 15:49:53 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2023-09-19 09:00:25 +00:00
|
|
|
<div id="app">
|
|
|
|
<ul class="modules">
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<script defer>
|
|
|
|
const $modules = document.querySelector('.modules');
|
|
|
|
const $avlTree = document.createElement('li');
|
|
|
|
const $avlTreeSpan = document.createElement('span');
|
|
|
|
$avlTreeSpan.innerText = 'AVLTree';
|
|
|
|
$avlTree.append($avlTreeSpan);
|
2023-09-21 16:53:34 +00:00
|
|
|
const {AVLTree, Queue} = dataStructureTyped;
|
2023-09-19 09:00:25 +00:00
|
|
|
const avlTree = new AVLTree();
|
|
|
|
|
|
|
|
avlTree.add(1, 1);
|
|
|
|
console.log(avlTree.BFS());
|
|
|
|
$modules.append($avlTree);
|
|
|
|
|
|
|
|
|
2023-09-21 16:53:34 +00:00
|
|
|
const queue = new Queue();
|
2023-09-19 09:00:25 +00:00
|
|
|
for (let i = 0; i < 1000000; i++) {
|
|
|
|
queue.enqueue(i);
|
|
|
|
}
|
|
|
|
let last = 0;
|
|
|
|
const startTime = performance.now();
|
|
|
|
|
|
|
|
for (let i = 0; i < 1000000; i++) {
|
|
|
|
last = queue.dequeue();
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(performance.now() - startTime)
|
|
|
|
</script>
|
2023-09-09 15:49:53 +00:00
|
|
|
|
|
|
|
</body>
|
2023-09-19 09:00:25 +00:00
|
|
|
</html>
|
2023-09-21 16:53:34 +00:00
|
|
|
|