mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +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:
@ -85,7 +85,7 @@ pub fn MyList(comptime T: type) type {
|
||||
pub fn remove(self: *Self, index: usize) T {
|
||||
if (index < 0 or index >= self.size()) @panic("索引越界");
|
||||
var num = self.arr[index];
|
||||
// 索引 i 之后的元素都向前移动一位
|
||||
// 将索引 index 之后的元素都向前移动一位
|
||||
var j = index;
|
||||
while (j < self.size() - 1) : (j += 1) {
|
||||
self.arr[j] = self.arr[j + 1];
|
||||
|
||||
Reference in New Issue
Block a user