This commit is contained in:
2023-09-22 09:51:10 -04:00
commit 1af8bd1e54
32 changed files with 346400 additions and 0 deletions

40
4-stack/README.md Normal file
View File

@ -0,0 +1,40 @@
Stack
=====
Wikipedia on [stacks](http://en.wikipedia.org/wiki/Stack_(abstract_data_type)).
Similarly, the Linked List, a stack is an abstract data type. It is LIFO, or Last In First Out. Each node holds data and a pointer to the next node.
###Visualization
|42|
|
|60|
|
|99|
|
|3|
|
None
The main operations available to the Stack are push and pop.
- Pop should remove the top node and return it.
- Push should add to the top of the stack.
###Methods
Create your datatypes and create the following methods:
- push - adds to the stack
- pop - removes from the top of the stack
- peek - Find the item at the top of the stack
- empty - Is the stack empty?
###Additional Methods
In the wikipedia article, read under the title "Hardware Stacks". Emulating a hardware stack, add the operations it lists to your class. This is open ended and implementation is up to you.

3
4-stack/stack.py Normal file
View File

@ -0,0 +1,3 @@
class Stack:
def __init__():
pass