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

https://github.com/lukman-01/udacity-python-dsa

Solutions to the exercises from Udacity course on Data Structures and Algorithms in Python.
https://github.com/lukman-01/udacity-python-dsa

datastructures-algorithms python3

Last synced: 4 months ago
JSON representation

Solutions to the exercises from Udacity course on Data Structures and Algorithms in Python.

Awesome Lists containing this project

README

        

# Python Data Structures and Algorithms (DSA) Solutions

This repository contains solutions to the exercises from the Udacity course on Data Structures and Algorithms in Python. Each folder in this repository corresponds to a different data structure or algorithm covered in the course.

## Folder Structure

- `stack/`
Solutions to problems related to stack operations, such as implementing a stack, balancing parentheses, etc.

- `queue/`
Exercises related to queues, including FIFO operations, circular queues, and dequeue implementations.

- `linked_list/`
Solutions to exercises involving singly and doubly linked lists, such as reversing a linked list, detecting cycles, and merging sorted linked lists.

- `tree/`
Includes problems on various types of trees (binary tree, binary search tree, etc.), such as traversals (inorder, preorder, postorder), tree height, and finding the least common ancestor (LCA).

- `graph/`
Contains solutions to graph-based problems, such as breadth-first search (BFS), depth-first search (DFS), shortest path algorithms (Dijkstra's), and detecting cycles in a graph.

- `sorting_algorithms/`
Solutions for sorting algorithm problems such as bubble sort, merge sort, quicksort, and insertion sort.

- `others/`
Miscellaneous problems covering additional data structures and algorithms like heaps, hash tables, dynamic programming, and recursion.

## Course Topics Covered

1. **Stacks**
Basic stack operations, balancing parentheses, and stack-based problem-solving.

2. **Queues**
Queue operations, circular queues, and use cases like the producer-consumer problem.

3. **Linked Lists**
Singly and doubly linked lists, efficient manipulation, and memory management.

4. **Trees**
Binary trees, binary search trees, AVL trees, and tree traversals (inorder, preorder, postorder).

5. **Graphs**
Representations of graphs, BFS, DFS, shortest path algorithms, and topological sorting.

6. **Sorting Algorithms**
Comparison-based sorts (bubble sort, quicksort, merge sort) and non-comparison sorts.

7. **Other Topics**
Hashing, dynamic programming, recursion, heaps, and additional algorithms.

## Getting Started

### Prerequisites

To run the Python scripts, you'll need Python 3.x installed on your machine. You can download Python from [here](https://www.python.org/downloads/).

### Running the Solutions

To run a particular exercise, navigate to the corresponding folder and execute the Python file. For example, to run the linked list exercises:

```bash
cd LinkedList
python3 LinkedList_Exercise.py
```

Each solution file includes comments explaining the problem and the approach used to solve it.