2023-09-09 15:49:53 +00:00
|
|
|
<!DOCTYPE html>
|
2023-09-26 04:49:33 +00:00
|
|
|
<html lang='en'>
|
2023-09-09 15:49:53 +00:00
|
|
|
<head>
|
2023-09-26 04:49:33 +00:00
|
|
|
<meta charset='UTF-8'>
|
2023-09-19 09:00:25 +00:00
|
|
|
<title>CDN Test</title>
|
2023-09-26 04:49:33 +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-26 04:49:33 +00:00
|
|
|
<div id='app'>
|
|
|
|
<ul class='modules'>
|
2023-09-19 09:00:25 +00:00
|
|
|
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<script defer>
|
|
|
|
const $modules = document.querySelector('.modules');
|
|
|
|
|
|
|
|
|
2023-10-05 02:37:42 +00:00
|
|
|
try {
|
|
|
|
const {AVLTree, Queue} = window.dataStructureTyped;
|
|
|
|
const avlTree = new AVLTree();
|
|
|
|
const $avlTree = document.createElement('li');
|
|
|
|
const $avlTreeSpan = document.createElement('span');
|
|
|
|
$avlTreeSpan.innerText = 'AVLTree';
|
|
|
|
$avlTree.append($avlTreeSpan);
|
|
|
|
avlTree.add(1, 1);
|
|
|
|
console.log(avlTree.BFS());
|
|
|
|
$modules.append($avlTree);
|
2023-09-19 09:00:25 +00:00
|
|
|
|
|
|
|
|
2023-10-05 02:37:42 +00:00
|
|
|
const queue = new Queue();
|
|
|
|
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);
|
|
|
|
|
2023-10-25 07:51:50 +00:00
|
|
|
} catch (e) {
|
2023-10-05 02:37:42 +00:00
|
|
|
console.error(e);
|
2023-09-19 09:00:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
</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
|
|
|
|