Costa Rica
Belinda Brown, [email protected]
June 2019
Stacks and Queues are fundamental data structures in computer science that are used in various types of computation.
A Stack is a linear data structure that follows a particular order in which operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). Mainly the following three basic operations are performed in the stack:
- Push: Adds an element to the collection.
- Pop: Removes an element from the collection.
- Peek/Top: Returns the topmost element without removing it.
A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO). A good example of a queue is any queue of consumers for a resource where the consumer that came first is served first. The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added.
To run the program, you need to navigate to the folder containing the program using your console or terminal.
- Navigate to the "Balanceo_signos_agrupacion" folder.
- Once inside the folder, type the following command in the console or terminal:
$ make
- Navigate to the “Prioridad” folder.
- Once inside the folder, type the following command in the console or terminal:
$ make
The above command compiles the code. To run the compiled program, type the following command:
./prioridad.exe 4 1:1:2:1