fix: fix some comment

pull/163/head
S-N-O-R-L-A-X 2 years ago
parent 0394f0c547
commit c20f7cdaac

@ -1,5 +1,5 @@
/**#stkSize
* File: linkedlist_queue.js
* File: linkedlist_stack.js
* Created Time: 2022-12-22
* Author: S-N-O-R-L-A-X (snorlax.xu@outlook.com)
*/
@ -52,7 +52,7 @@ class LinkedListStack {
return this.#stackPeek.val;
}
/* 将 List 转化为 Array 并返回 */
/* 将链表转化为 Array 并返回 */
toArray() {
let node = this.#stackPeek;
const res = new Array(this.size);

@ -1,5 +1,5 @@
/**
* File: linkedlist_queue.ts
* File: linkedlist_stack.ts
* Created Time: 2022-12-21
* Author: S-N-O-R-L-A-X (snorlax.xu@outlook.com)
*/
@ -52,7 +52,7 @@ class LinkedListStack {
return this.stackPeek.val;
}
/* 将 List 转化为 Array 并返回 */
/* 将链表转化为 Array 并返回 */
toArray(): number[] {
let node = this.stackPeek;
const res = new Array<number>(this.size);

@ -396,6 +396,7 @@ comments: true
=== "TypeScript"
```typescript title="linkedlist_stack.ts"
/* 基于链表实现的栈 */
class LinkedListStack {
private stackPeek: ListNode | null; // 将头结点作为栈顶
private stkSize: number = 0; // 栈的长度
@ -441,7 +442,7 @@ comments: true
return this.stackPeek.val;
}
/* 将 List 转化为 Array 并返回 */
/* 将链表转化为 Array 并返回 */
toArray(): number[] {
let node = this.stackPeek;
const res = new Array<number>(this.size);

Loading…
Cancel
Save