An open API service indexing awesome lists of open source software.

https://github.com/monciego/dsa

Data Structures and Algorithms
https://github.com/monciego/dsa

Last synced: about 21 hours ago
JSON representation

Data Structures and Algorithms

Awesome Lists containing this project

README

        

## Data Structures and Algorithms

**Data Structures** - a named location that can be used to store and organize data.
**Algorithm** - a collection of steps to solve a problem.

---

**Data Structures**

- **Stacks 📚**

- Last In First Out (LIFO) data structure.
- Stores objects into a sort of "vertical tower"
- push() to add to the top
- pop() to remove to from the top

**Uses of stacks?**

1. Undo/Redo features in text editors.
2. Moving back/forward through browser history.
3. Backtracking algorithms (maze, file directories)
4. Calling functions (call stack)

- **Queues 🎟️**

- First In First Out (FIFO) data structure (ex. a line of people)
- A collection designed for holding elements prior to processing linear data structure
- add = enqueue, offer()
- remove = dequeue, poll()
- examine = element(), peek()

**Uses of queues?**

1. Keyboard buffer (letters should appear on the screen in order they're pressed)
2. Printer Queue (print jobs should be completed in order)
3. Used in Linkedlists, PriorityQueues, Breadth-first search

- **Priority Queues 🎟️**

- First In First Out (FIFO) data structure that serves elements with the highest priorities first before elements with lower priority

---

> We learn Data Structures and Algorithms to write code that is both time and memory efficent.