vimwiki/tech/stack.wiki

23 lines
565 B
Plaintext

= Stack =
First in Last Out container. Think like a stack of plates, you take off the top
first. Really speciallized and great for things like pre/postfix parsing and
like
== Good For ==
* Keeping an order of things added
== Bad For ==
* Everything else
== Optomize ==
You can make this either just an array with a pointer to the top of the stack,
or as a big single linked list that keeps track of the head. Use the array when
you know the max number of elements, otherwise use a linked list. If caching is
a concern, use the array version.
[[algorithms]]