Skip to content

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?

Notifications You must be signed in to change notification settings

belovetech/monty

Repository files navigation

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 <int> where <int> is an integer

What it does: pushes an element to the stack.

pall

Usage: pall

What it does: prints all the values on the stack, starting from the top of the stack.

pint

Usage: pint

What it does: prints the value at the top of the stack followed by a new line.

pop

Usage: pop

What it does: removes the top element of the stack.

swap

Usage: swap

What it does: swaps the top two elements of the stack.

add

Usage: add

What 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: sub

What 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: div

What 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: mul

What 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: mod

What 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

About

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?

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published