mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-10 14:15:37 +08:00
build
This commit is contained in:
@@ -16,8 +16,6 @@ comments: true
|
||||
|
||||
栈的常用操作见下表(方法命名以 Java 为例)。
|
||||
|
||||
<p align="center"> Table. 栈的常用操作 </p>
|
||||
|
||||
<div class="center-table" markdown>
|
||||
|
||||
| 方法 | 描述 | 时间复杂度 |
|
||||
@@ -272,7 +270,7 @@ comments: true
|
||||
对于入栈操作,将元素插入到链表头部即可,这种结点添加方式被称为“头插法”。而对于出栈操作,则将头结点从链表中删除即可。
|
||||
|
||||
=== "LinkedListStack"
|
||||

|
||||

|
||||
|
||||
=== "push()"
|
||||

|
||||
@@ -849,7 +847,7 @@ comments: true
|
||||
使用「数组」实现栈时,考虑将数组的尾部当作栈顶。这样设计下,「入栈」与「出栈」操作就对应在数组尾部「添加元素」与「删除元素」,时间复杂度都为 $O(1)$ 。
|
||||
|
||||
=== "ArrayStack"
|
||||

|
||||

|
||||
|
||||
=== "push()"
|
||||

|
||||
|
||||
Reference in New Issue
Block a user