Skip to content

gowthams007/DSAWithJava

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’» DSAWithJava

Welcome to DSAWithJava β€” a structured and comprehensive collection of Java programs covering everything from Java fundamentals to advanced Data Structures and Algorithms.

This repository is designed to help learners, job seekers, and competitive programmers strengthen their DSA skills using Java, with well-documented solutions, problem statements, and explanations for each topic.


πŸš€ Why Use This Repository?

  • βœ… Covers Java Basics to Advanced DSA
  • βœ… Clean directory-wise topic separation
  • βœ… Each sub-topic includes:
    • πŸ“„ README.md with explanation
    • πŸ’» Well-written .java code
  • βœ… Ideal for:
    • Interview preparation
    • Competitive coding
    • Academic understanding
    • Self-paced DSA learning

🧭 Repository Structure

Each folder represents a major DSA topic or concept and contains:

  • One or more .java source files
  • A topic-wise README.md file with:
    • Problem descriptions
    • Intuition and approach
    • Code overview and complexity analysis
DSAWithJava/
β”œβ”€β”€ JavaBasics/         # Variables, Loops, Conditionals, etc.
β”œβ”€β”€ OOPs/               # Classes, Objects, Inheritance, Polymorphism
β”œβ”€β”€ Arrays/             # 1D & 2D Arrays, Prefix Sum, Sliding Window
β”œβ”€β”€ Strings/            # StringBuilder, Palindromes, Anagrams
β”œβ”€β”€ Recursion/          # Backtracking, Subsets, Permutations
β”œβ”€β”€ Sorting/            # Quick Sort, Merge Sort, Bubble, etc.
β”œβ”€β”€ Searching/          # Binary Search, Search in Rotated Array
β”œβ”€β”€ LinkedLists/        # Singly, Doubly, Reversal, Cycle Detection
β”œβ”€β”€ Stacks/             # Stack using Array/LL, Infix to Postfix
β”œβ”€β”€ Queues/             # Circular Queue, Deque, Queue using Stack
β”œβ”€β”€ Trees/              # Binary Tree, BST, Traversals, Diameter
β”œβ”€β”€ Heaps/              # Max/Min Heap, Priority Queue
β”œβ”€β”€ Tries/              # Word Break, Prefix Search, Longest Word
β”œβ”€β”€ Graphs/             # BFS, DFS, Dijkstra, Topo Sort, Kosaraju
β”œβ”€β”€ DynamicProgramming/ # Knapsack, LIS, LCS, Memoization & Tabulation
β”œβ”€β”€ Greedy/             # Activity Selection, Job Scheduling
β”œβ”€β”€ BitManipulation/    # Bitwise Operations, Power of 2, XOR Tricks
└── README.md           # ← You are here!

πŸ“š Major Concepts Covered

1. Java Fundamentals

  • Variables & Data Types
  • Operators & Expressions
  • Conditionals and Loops
  • Functions & Recursion
  • Input/Output Handling

2. Object-Oriented Programming

  • Classes & Objects
  • Constructors, Encapsulation
  • Inheritance & Polymorphism
  • Abstraction & Interfaces

3. Core DSA Topics

Topic Concepts Included
Arrays Prefix Sum, Kadane’s, Subarrays
Strings Character Maps, StringBuilder, Reversal
Linked Lists Cycle Detection, Reversal, Merge Sort
Stacks & Queues Stack using Queue, Next Greater Element
Trees Traversals, Diameter, LCA, Binary Search Trees
Graphs DFS, BFS, Topo Sort, Dijkstra, Kosaraju
Tries Word Break, Prefix Match, Autocomplete
DP Knapsack, LIS, LCS, Matrix DP
Greedy Huffman Coding, Job Scheduling
Bitwise XOR Tricks, Subsets, Bit Counting

πŸ“Œ Sample Highlight: Tries

The Tries/ directory includes:

  • Word Break using Trie
  • Prefix Search using startsWith()
  • Counting nodes in a suffix Trie
  • Finding shortest unique prefix
  • Finding the longest word built one char at a time

Each with:

  • Problem statement
  • Code walkthrough
  • Time & space complexity analysis

βš™οΈ How to Use

πŸ“₯ Clone the Repo

git clone git@github.com:harshityadav-7/DSAWithJava.git
cd DSAWithJava

πŸ’» Run Java Files

Use VS Code or any IDE like IntelliJ, Eclipse.

Or from terminal:

javac FileName.java
java FileName

πŸ‘¨β€πŸ’» Author

Harshit Yadav
πŸ“ Passionate about DSA, Java, Web Development, and AI
πŸ”— GitHub: @harshityadav-7


⭐ If this repo helps you, give it a star!

Feel free to fork it, contribute, and use it in your own prep journey πŸš€


🧠 Future Plans

  • Add LeetCode and GFG links to each problem
  • Add complexity tables in each topic's README
  • Add YouTube video links for explanations
  • Add practice sheets and roadmaps

About

πŸ“š Complete Java DSA repository β€” from basics to advanced algorithms (including Graphs, Tries, Recursion, and more).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%