Skip to content

nickunderhill/algo-workout

Repository files navigation

Tests

Algo Workout (Java)

A focused Java workspace for practicing data structures and algorithms for coding interviews.

Project Structure

.
├─ README.md
└─ src
   ├─ main
   │  └─ java
   │     └─ com/podopryhora/algoworkout
   │        ├─ App.java
   │        ├─ algorithms
   │        ├─ ds
   │        └─ leetcode
   └─ test
      └─ java
         └─ com/podopryhora/algoworkout

Getting Started

Run tests with the Gradle wrapper:

./gradlew test

Implementation Plan (Easiest → Hardest)

Data Structures

  • Arrays (custom dynamic array)
  • Singly linked list
  • Doubly linked list
  • Stack (array + linked list)
  • Queue (array + linked list)
  • Blocking queue (array + lock)
  • Deque
  • Hash map
  • Hash table (separate chaining)
  • Hash table (open addressing)
  • Binary heap (min/max)
  • Binary search tree
  • AVL tree
  • Red-black tree
  • Trie
  • Disjoint set (union-find)
  • Graph (adjacency list/matrix)

Algorithms

  • Linear search
  • Binary search
  • Two pointers patterns
  • Sliding window
  • Fixed window
  • Prefix sum
  • Sorting: bubble, selection, insertion
  • Sorting: merge, quick, heap
  • Bit manipulation basics
  • Recursion patterns
  • LRU cache
  • Backtracking: subsets, permutations, combinations
  • Token Bucket Algorithm
  • Leaky Bucket Algorithm
  • Greedy: interval scheduling, activity selection
  • BFS / DFS
  • Topological sort
  • Shortest path: Dijkstra, Bellman-Ford
  • Minimum spanning tree: Kruskal, Prim
  • Dynamic programming: 1D (fib, house robber)
  • Dynamic programming: 2D (knapsack, LCS)
  • String algorithms: KMP, Rabin-Karp
  • Advanced: segment tree, Fenwick tree

LeetCode problems

Easy

  • Two Sum
  • Palindrome Number
  • Fizz Buzz
  • Array Shuffle
  • Max Consecutive Ones
  • Valid Palindrome
  • Best Time to Buy and Sell Stock

Medium

  • Longest Palindromic Substring
  • Add Two Numbers
  • Three Sum
  • Longest Substring Without Repeating Characters
  • Best Time to Buy and Sell Stock II

Hard

  • Best Time to Buy and Sell Stock III
  • Best Time to Buy and Sell Stock IV
  • Best Time to Buy and Sell Stock with Cooldown

Example

  • LinearSearch lives in src/main/java/com/podopryhora/algoworkout/algorithms/search/LinearSearch.java
  • Tests live in src/test/java/com/podopryhora/algoworkout/algorithms/search/LinearSearchTest.java

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages