daggzu / holbertonschool-monty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

holbertn

C - Stacks, Queues - LIFO, FIFO

DESCRIPTION

Stack:

  • A Stack is a linear data structure that follows the LIFO principle, which stands for "Last In, First Out."
  • The last element added to the stack is the first to be removed. Imagine a stack of plates: the last plate you place on top is the first to be removed.
  • The fundamental operations on a stack are "push" (add an element) and "pop" (remove an element).
  • Stacks are commonly used in a variety of applications, such as managing function calls in a call stack in programming or in back navigation in a web browser.

Queue:

  • A Queue is another linear data structure that follows the FIFO principle, which stands for "First In, First Out."
  • This implies that the first element added to the queue is the first to be removed. Imagine a line of people waiting in a store: the first person to arrive is the first to be served.
  • The basic operations on a queue are "enqueue" (add an element) and "dequeue" (remove an element).
  • Queues are used in situations where it is important to maintain a specific order of items, such as in managing tasks in an operating system or printing documents on a printer.

Stacks and queues

They are data structures that are used to manage elements in a specific order. Stacks follow the LIFO principle, while queues follow the FIFO principle, and each has unique applications in solving programming problems and managing data in various situations.

Stack and Queues

Repo:

    GitHub repository: holbertonschool-monty

Tasks:

 0. push, pall 
 1. pint
 2. pop 
 3. swap 
 4. add 
 5. nop

File:

README.md
main.c
montyadd.c
montypall.c
montypint.c
montypush.c

About


Languages

Language:C 100.0%