Welcome! This guide will help you get started with your DSA learning journey.
Install Requirements:
- Java 23 or higher (Download)
- Maven 3.6+ (Download)
- IDE of your choice:
- IntelliJ IDEA (Recommended)
- VS Code with Java extensions
- Eclipse
Clone and Build:
# Clone the repository
git clone <your-repo-url>
cd data-structures-self-learning
# Build the project
mvn clean install
# Verify everything works
mvn testComplete Beginner? Start here:
- Linear Search (
wiki/LinearSearch.md) - Stack (
wiki/Stack.md) - Bubble Sort (
wiki/BubbleSort.md)
Some Programming Experience? Try:
- Binary Search (
wiki/BinarySearch.md) - LinkedList (
wiki/LinkedList.md) - Merge Sort (
wiki/MergeSort.md)
Preparing for Interviews? Focus on:
- All searching algorithms
- All sorting algorithms
- Graph (BFS/DFS)
- Dynamic Programming basics
Let's implement Linear Search together:
Step 1: Read the Guide
cat wiki/LinearSearch.md
# or open in your IDEStep 2: Open the File
src/main/java/com/dsa/algorithms/searching/LinearSearch.java
Step 3: Implement
public int search(int[] arr, int target) {
// Your implementation here
for (int i = 0; i < arr.length; i++) {
if (arr[i] == target) {
return i;
}
}
return -1;
}Step 4: Test
# Open the test file
src/test/java/com/dsa/algorithms/searching/LinearSearchTest.java
# Uncomment the test:
@Test
void testSearchFound() {
int[] arr = {5, 2, 8, 12, 1, 6};
assertEquals(3, linearSearch.search(arr, 12));
}
# Run the test
mvn test -Dtest=LinearSearchTestStep 5: Celebrate! 🎉
You just implemented and tested your first algorithm!
For each topic:
- Read - Spend 10-15 minutes understanding the concept
- Implement - Write the code (struggle is okay!)
- Test - Run tests and debug
- Reflect - Think about what you learned
Beginner (1 hour/day):
- 15 min: Read wiki guide
- 30 min: Implement
- 15 min: Test and debug
Intermediate (2 hours/day):
- 20 min: Read guide
- 60 min: Implement multiple methods
- 40 min: Test and optimize
Advanced (2-3 hours/day):
- Multiple algorithms per day
- Focus on optimization
- Solve related LeetCode problems
- Read the wiki guide first
- Think about edge cases (empty input, single element, etc.)
- Draw diagrams on paper
- Take breaks when stuck
- Celebrate small wins
- Ask questions in discussions
- Don't copy-paste solutions from the internet
- Don't skip the wiki guides
- Don't ignore failing tests
- Don't give up after 5 minutes
- Don't skip "easy" topics
Try this sequence:
- Re-read the wiki guide (5 minutes)
- Draw the problem on paper (10 minutes)
- Look at test cases for hints (5 minutes)
- Take a 15-minute break (walk, coffee, etc.)
- Try again with fresh eyes (15 minutes)
- Search for high-level concepts (not code) online (10 minutes)
- Ask for help in discussions (explain what you've tried)
Create a file MY_PROGRESS.md in the root directory:
# My Learning Journey
## Week 1
- [x] Linear Search - Completed 2025-01-15
- [x] Stack - Completed 2025-01-16
- [ ] Binary Search - In progress
## Challenges Faced
- Struggled with binary search edge cases
- Learned about integer overflow in mid calculation
## Next Week Goals
- Complete all searching algorithms
- Start on sorting algorithms- Complete 5 basic algorithms
- Understand O(n) vs O(log n)
- Write your first test from scratch
- Implement all basic data structures
- Understand all common sorting algorithms
- Complete 20 LeetCode easy problems using these concepts
- Implement all algorithms in this repo
- Understand advanced topics (graphs, DP)
- Ready for technical interviews
- Linear Search
- Binary Search
- Bubble Sort
- Stack
- Queue
- ArrayList
- LinkedList
- Binary Search Tree
- Min Heap
- Insertion Sort
- Merge Sort
- Quick Sort
- DFS/BFS
- Trie
- Graph
- Dijkstra's
- Dynamic Programming
- Run test:
Ctrl+Shift+F10(Win) /Cmd+Shift+R(Mac) - Debug:
Shift+F9 - Format code:
Ctrl+Alt+L(Win) /Cmd+Option+L(Mac)
- Run test: Click "Run Test" above test method
- Debug: Click "Debug Test"
- Format:
Shift+Alt+F(Win) /Shift+Option+F(Mac)
While implementing, these might help:
- Visualgo - Algorithm animations
- Big-O Cheatsheet - Complexity reference
Consider keeping notes for each topic:
# Binary Search Notes
## Key Insight
- Only works on sorted arrays
- Halves the search space each time
## Gotcha
- Use `left + (right - left) / 2` to avoid overflow
## When to use
- Large sorted datasets
- Need O(log n) performance- Star the repository
- Fork and track your progress
- Share your learning journey
- Help others in discussions
- ✨ First algorithm implemented
- 🌟 All tests passing
- 🎯 First data structure complete
- 🚀 First advanced algorithm
- 🏆 All algorithms implemented
Remember: Everyone starts as a beginner. The key is to start and keep going!
- Open an issue for bugs
- Start a discussion for questions
- Check existing issues for common problems
Ready to start? Pick your first algorithm and dive in! 🚀
Happy Learning! 💻