A collection of algorithms and data structures inspired by the course “The Last Algorithms Course You’ll Need” from FrontendMasters. The repository includes tests using pytest and covers concepts such as sorting, recursion, searching, heaps, and tree traversals.

Algorithms and Data Structures

Sorting Algorithms

  • Bubble Sort: Simple comparison-based sorting algorithm with O(n²) complexity.
  • Quick Sort: Efficient divide-and-conquer algorithm with average O(n log n) complexity.

Recursion

  • Maze Solver: Uses recursive backtracking to find a path through a maze.

Searching Algorithms

  • Binary Search: Efficiently searches sorted arrays with O(log n) complexity.
  • Search Problem (Two Crystal Balls): Optimized algorithm to find a breakpoint with minimized jumps, O(√n) complexity.

Heap

  • Min Heap: Tree-based structure allowing quick retrieval/removal of the smallest element with O(log n) complexity.

Tree Algorithms

  • Breadth-First Search (BFS): Explores nodes level-by-level in a graph/tree with O(n) complexity.
  • Tree Traversals:
    • PreOrder: Root → Left → Right traversal.
    • InOrder: Left → Root → Right traversal.
    • PostOrder: Left → Right → Root traversal.

Take a look here.