The documentation has been changed to mdbook
Check it out: https://rust-lang.github.io/mdBook/index.html
This commit is contained in:
1 parent
4e96d3aba0
commit
062c03091c
107 files changed
+9283
-5280
No files matched your search
@@ -0,0 +1,9 @@
|
||||
# stack.h
|
||||
|
||||
A Stack is a Last-in First-out (or First-in Last-out) data structure used in a variety of algorithms. It is a Dynamic Array that can only add or remove its elements at the end of the buffer, in this case, it represents the top of the stack.
|
||||
|
||||
## Stack Implementation
|
||||
|
||||
It has three main functions: `push` which adds an element at the top of the stack; `pop` which removes the top element from the stack; and `top` which returns the top element without removing it (it is also sometimes called `peek`).
|
||||
|
||||
A Stack is used in algorithms like backtracking, depth-first search, expression evaluation, syntax parsing and many more.
|
||||
Reference in new issue
Block a user