mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-01 20:12:07 +08:00
feat: Add visualizing code blocks based on the pythontutor (#1029)
* Update copyright * Update the Python code * Fix the code comments in ArrayBinaryTree * Fix the code comments in ArrayBinaryTree * Roll back time_comlexity.py * Add the visualizing code(pythontutor) blocks to the chapter complexity, data structure, array and linked list, stack and queue, hash table, and backtracking * Fix the code comments
This commit is contained in:
@ -68,7 +68,7 @@ class MyList {
|
||||
public remove(index: number): number {
|
||||
if (index < 0 || index >= this._size) throw new Error('索引越界');
|
||||
let num = this.arr[index];
|
||||
// 将索引 index 之后的元素都向前移动一位
|
||||
// 将将索引 index 之后的元素都向前移动一位
|
||||
for (let j = index; j < this._size - 1; j++) {
|
||||
this.arr[j] = this.arr[j + 1];
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ class ArrayBinaryTree {
|
||||
this.#tree = arr;
|
||||
}
|
||||
|
||||
/* 节点数量 */
|
||||
/* 列表容量 */
|
||||
size(): number {
|
||||
return this.#tree.length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user