OSDN Git Service

feat: add stack and queue
authorIr1d <sirius.caffrey@gmail.com>
Thu, 23 Aug 2018 11:48:59 +0000 (19:48 +0800)
committerIr1d <sirius.caffrey@gmail.com>
Thu, 23 Aug 2018 11:48:59 +0000 (19:48 +0800)
docs/data-structure/novice/queue.md [new file with mode: 0644]
docs/data-structure/novice/stack.md [new file with mode: 0644]
mkdocs.yml

diff --git a/docs/data-structure/novice/queue.md b/docs/data-structure/novice/queue.md
new file mode 100644 (file)
index 0000000..fda2823
--- /dev/null
@@ -0,0 +1,8 @@
+队列,英文名是 queue,在 C++ STL 中有 [std::queue](https://en.cppreference.com/w/cpp/container/queue) 和 [std::priority_queue](https://en.cppreference.com/w/cpp/container/priority_queue)。
+
+下列说法正确吗?
+
+- 先进入队列的元素一定先出队列
+
+- 先进入队列的元素一定后出队列
+
diff --git a/docs/data-structure/novice/stack.md b/docs/data-structure/novice/stack.md
new file mode 100644 (file)
index 0000000..dc405d4
--- /dev/null
@@ -0,0 +1,7 @@
+栈,英文名是 stack, C++ STL 中有 [std::stack](https://en.cppreference.com/w/cpp/container/stack),不过一般都直接用数组模拟一个栈,也十分方便。
+
+下列说法正确吗?
+
+- 先进入栈的元素一定先出栈
+
+- 先进入栈的元素一定后出栈
\ No newline at end of file
index 7a2963f..88fc4d2 100644 (file)
@@ -111,6 +111,8 @@ nav:
     - STL: data-structure/stl.md
     - pb_ds: data-structure/pb-ds.md
     - 基础数据结构:
+      - 栈: data-structure/novice/stack.md
+      - 队列: data-structure/novice/queue.md
       - 链表: data-structure/novice/linked-list.md
       - 哈希表: data-structure/novice/hash.md
       - 并查集: data-structure/novice/dsu.md