Fix array queue.

This commit is contained in:
Yudong Jin
2023-02-01 03:23:29 +08:00
parent 658ad90377
commit 5eae708035
15 changed files with 425 additions and 365 deletions
+10 -10
View File
@@ -7,16 +7,6 @@
import ListNode from './ListNode';
import { TreeNode } from './TreeNode';
class Trunk {
prev: Trunk | null;
str: string;
constructor(prev: Trunk | null, str: string) {
this.prev = prev;
this.str = str;
}
}
/**
* Print a linked list
* @param head
@@ -30,6 +20,16 @@ function printLinkedList(head: ListNode | null): void {
console.log(list.join(' -> '));
}
class Trunk {
prev: Trunk | null;
str: string;
constructor(prev: Trunk | null, str: string) {
this.prev = prev;
this.str = str;
}
}
/**
* The interface of the tree printer
* This tree printer is borrowed from TECHIE DELIGHT