https://github.com/belovetech/monty
Data Structures in C - Stacks (LIFO) and Queues (FIFO). This project's goal is to learn about non-primitive linear data structures and their applications. What do LIFO and FIFO mean? What exactly is a stack, and when should you use it? What exactly is a queue, and when should you use it? What are the most common applications for stacks and queues?
https://github.com/belovetech/monty
c data-structure-and-algorithm queue stack
Last synced: 2 months ago
JSON representation
Data Structures in C - Stacks (LIFO) and Queues (FIFO). This project's goal is to learn about non-primitive linear data structures and their applications. What do LIFO and FIFO mean? What exactly is a stack, and when should you use it? What exactly is a queue, and when should you use it? What are the most common applications for stacks and queues?
- Host: GitHub
- URL: https://github.com/belovetech/monty
- Owner: belovetech
- Created: 2022-06-18T20:00:42.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-19T20:23:32.000Z (almost 3 years ago)
- Last Synced: 2025-01-06T11:40:20.028Z (4 months ago)
- Topics: c, data-structure-and-algorithm, queue, stack
- Language: C
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stacks, Queues - LIFO, FIFO
## Monty
A project for Alx Africa, this is an interpreter for Monty bytecodes files.
Monty is a scripting language that is first compiled into Monty byte codes.
It relies on a unique stack data structure with specific instructions to manipulate it.
Monty byte codes usually have the .m extension.
## push
Usage: push where is an integerWhat it does: pushes an element to the stack.
## pall
Usage: pallWhat it does: prints all the values on the stack, starting from the top of the stack.
## pint
Usage: pintWhat it does: prints the value at the top of the stack followed by a new line.
## pop
Usage: popWhat it does: removes the top element of the stack.
## swap
Usage: swapWhat it does: swaps the top two elements of the stack.
## add
Usage: addWhat it does: adds the top two elements of the stack. The answer is stored in the second top
element of the stack and the top element is removed so that the top element contains the result
and the stack is one element shorter.## sub
Usage: subWhat it does: subtracts the top element of the stack from the second element of the stack.
The answer is stored in the second top element of the stack and the top element is removed
so that the top element contains the result and the stack is one element shorter.## div
Usage: divWhat it does: divides the second top element of the stack by the first element of the stack.
The answer is stored in the second top element of the stack and the top element is removed so
that the top element contains the result and the stack is one element shorter.## mul
Usage: mulWhat it does: multiplies the top two elements of the stack.
The answer is stored in the second top element of the stack
and the top element is removed so that the top element contains the result and the stack is one element shorter.## mod
Usage: modWhat it does: computes the remainder of the division of the second top element of the stack by the top element of the stack.
The answer is stored in the second top element of the stack and the top element is removed so that the top element contains
the result and the stack is one element shorter.## Authors
- Abeeb Raheem
- Junaid-eko Raimot