Add TypeScript code and docs to AVL tree and the coding style for Typescript and JavaScript (#342)

* Add TypeScript code and docs to AVL tree and update JavaScript style

* Update the coding style for Typescript and JavaScript
This commit is contained in:
Justin Tse
2023-02-07 01:21:58 +08:00
committed by GitHub
parent 7f4243ab77
commit b14568151c
9 changed files with 453 additions and 49 deletions

View File

@ -6,7 +6,7 @@
/* 生成一个数组,元素为 { 1, 2, ..., n },顺序被打乱 */
function randomNumbers(n) {
let nums = Array(n);
const nums = Array(n);
// 生成数组 nums = { 1, 2, 3, ..., n }
for (let i = 0; i < n; i++) {
nums[i] = i + 1;