Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SatinderSinghSall/DSA-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

507 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

β˜• Java Programming and Data Structures & Algorithms

Welcome to the Java Programming, Data Structures, and Algorithms repository!

This repository is a complete guide for learning Java programming, understanding core data structures, and mastering essential algorithms β€” all in one place. It’s designed for students, beginners, and professionals revisiting fundamental computer science concepts.


πŸš€ Features

  • βœ… Step-by-step Java examples
  • 🧩 Data Structures implemented from scratch
  • βš™οΈ Core and advanced Algorithms
  • πŸ’‘ Clear explanations and code comments
  • πŸ§ͺ Example inputs/outputs for clarity
  • πŸ—οΈ Well-organized modular project structure
  • ⚑ Beginner-friendly and ready to run

🧰 Tech Stack

Component Description
Language Java (JDK 17 or later)
Compiler javac (Java Compiler)
IDE Support IntelliJ IDEA, VS Code, Eclipse, NetBeans
Build Tools Maven / Gradle (optional)

πŸ“‚ Repository Structure

Java-Programming-DataStructures-Algorithms/
β”œβ”€β”€ README.md
β”œβ”€β”€ 01_Basics/
β”‚   β”œβ”€β”€ HelloWorld.java
β”‚   β”œβ”€β”€ Operators.java
β”‚   β”œβ”€β”€ ControlStatements.java
β”‚   β”œβ”€β”€ Loops.java
β”‚   β”œβ”€β”€ ArraysIntro.java
β”‚   └── InputOutput.java
β”‚
β”œβ”€β”€ 02_ObjectOrientedProgramming/
β”‚   β”œβ”€β”€ ClassesObjects.java
β”‚   β”œβ”€β”€ InheritanceDemo.java
β”‚   β”œβ”€β”€ Polymorphism.java
β”‚   β”œβ”€β”€ Encapsulation.java
β”‚   └── Abstraction.java
β”‚
β”œβ”€β”€ 03_Data_Structures/
β”‚   β”œβ”€β”€ Arrays/
β”‚   β”‚   β”œβ”€β”€ LinearSearch.java
β”‚   β”‚   └── BinarySearch.java
β”‚   β”œβ”€β”€ LinkedLists/
β”‚   β”‚   β”œβ”€β”€ SinglyLinkedList.java
β”‚   β”‚   β”œβ”€β”€ DoublyLinkedList.java
β”‚   β”‚   └── CircularLinkedList.java
β”‚   β”œβ”€β”€ Stacks/
β”‚   β”‚   β”œβ”€β”€ StackUsingArray.java
β”‚   β”‚   └── StackUsingLinkedList.java
β”‚   β”œβ”€β”€ Queues/
β”‚   β”‚   β”œβ”€β”€ QueueUsingArray.java
β”‚   β”‚   └── QueueUsingLinkedList.java
β”‚   β”œβ”€β”€ Trees/
β”‚   β”‚   β”œβ”€β”€ BinaryTree.java
β”‚   β”‚   β”œβ”€β”€ BinarySearchTree.java
β”‚   β”‚   └── TreeTraversal.java
β”‚   β”œβ”€β”€ Graphs/
β”‚   β”‚   β”œβ”€β”€ GraphAdjacencyList.java
β”‚   β”‚   └── GraphAdjacencyMatrix.java
β”‚   β”œβ”€β”€ Hashing/
β”‚   β”‚   β”œβ”€β”€ HashMapDemo.java
β”‚   β”‚   └── HashSetDemo.java
β”‚   └── Heaps/
β”‚       β”œβ”€β”€ MinHeap.java
β”‚       └── MaxHeap.java
β”‚
β”œβ”€β”€ 04_Algorithms/
β”‚   β”œβ”€β”€ Searching/
β”‚   β”‚   β”œβ”€β”€ LinearSearch.java
β”‚   β”‚   └── BinarySearch.java
β”‚   β”œβ”€β”€ Sorting/
β”‚   β”‚   β”œβ”€β”€ BubbleSort.java
β”‚   β”‚   β”œβ”€β”€ SelectionSort.java
β”‚   β”‚   β”œβ”€β”€ InsertionSort.java
β”‚   β”‚   β”œβ”€β”€ MergeSort.java
β”‚   β”‚   └── QuickSort.java
β”‚   β”œβ”€β”€ Recursion/
β”‚   β”‚   β”œβ”€β”€ Factorial.java
β”‚   β”‚   β”œβ”€β”€ Fibonacci.java
β”‚   β”‚   └── TowerOfHanoi.java
β”‚   β”œβ”€β”€ DivideAndConquer/
β”‚   β”‚   └── BinarySearchRecursive.java
β”‚   β”œβ”€β”€ Greedy/
β”‚   β”‚   β”œβ”€β”€ ActivitySelection.java
β”‚   β”‚   └── FractionalKnapsack.java
β”‚   β”œβ”€β”€ DynamicProgramming/
β”‚   β”‚   β”œβ”€β”€ FibonacciDP.java
β”‚   β”‚   β”œβ”€β”€ LongestCommonSubsequence.java
β”‚   β”‚   β”œβ”€β”€ Knapsack01.java
β”‚   β”‚   └── CoinChange.java
β”‚   β”œβ”€β”€ GraphAlgorithms/
β”‚   β”‚   β”œβ”€β”€ BFS.java
β”‚   β”‚   β”œβ”€β”€ DFS.java
β”‚   β”‚   β”œβ”€β”€ Dijkstra.java
β”‚   β”‚   β”œβ”€β”€ Kruskal.java
β”‚   β”‚   β”œβ”€β”€ Prim.java
β”‚   β”‚   └── TopologicalSort.java
β”‚   └── Backtracking/
β”‚       β”œβ”€β”€ NQueens.java
β”‚       └── SudokuSolver.java
β”‚
└── 05_Extras/
    β”œβ”€β”€ FileHandling.java
    β”œβ”€β”€ ExceptionHandling.java
    β”œβ”€β”€ LambdaExpressions.java
    └── CollectionsFrameworkDemo.java

πŸ“˜ Topics Covered

πŸ”Ή Java Fundamentals

  • Variables, Data Types, Operators
  • Control Statements (if, switch, loops)
  • Methods and Recursion
  • Arrays and Strings
  • Input/Output and Exception Handling

πŸ”Ή Object-Oriented Programming (OOP)

  • Classes and Objects
  • Constructors, this & super keywords
  • Inheritance, Polymorphism, Encapsulation, Abstraction
  • Interfaces and Abstract Classes
  • Packages and Access Modifiers

πŸ”Ή Data Structures

  • Arrays & Strings
  • Linked Lists (Singly, Doubly, Circular)
  • Stacks and Queues
  • Trees (Binary Tree, BST, Traversals)
  • Heaps (Min/Max)
  • Graphs (Adjacency List / Matrix, BFS, DFS)
  • Hash Maps, Sets, and Priority Queues

πŸ”Ή Algorithms

🧠 Searching Algorithms

  • Linear Search
  • Binary Search (Iterative & Recursive)

πŸŒ€ Sorting Algorithms

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort
  • Counting Sort
  • Radix Sort

πŸ” Recursion & Backtracking

  • Factorial, Fibonacci
  • Tower of Hanoi
  • N-Queens Problem
  • Sudoku Solver

πŸ”— Divide and Conquer

  • Binary Search
  • Merge Sort
  • Quick Sort

πŸ’° Greedy Algorithms

  • Activity Selection
  • Fractional Knapsack
  • Huffman Coding
  • Job Sequencing

βš™οΈ Dynamic Programming

  • Fibonacci (DP Approach)
  • Longest Common Subsequence (LCS)
  • 0/1 Knapsack
  • Coin Change Problem
  • Matrix Chain Multiplication
  • Longest Increasing Subsequence

🌐 Graph Algorithms

  • Breadth First Search (BFS)
  • Depth First Search (DFS)
  • Dijkstra’s Algorithm
  • Kruskal’s Minimum Spanning Tree
  • Prim’s Algorithm
  • Topological Sorting
  • Bellman-Ford Algorithm
  • Floyd-Warshall Algorithm

⚑ Quick Start

# Clone the repository
git clone https://github.com/SatinderSinghSall/Java-Programming-DataStructures-Algorithms.git

# Navigate to the project folder
cd Java-Programming-DataStructures-Algorithms

# Compile and run an example
javac 03_Data_Structures/LinkedLists/SinglyLinkedList.java
java 03_Data_Structures.LinkedLists.SinglyLinkedList

πŸ§ͺ Example Program

SinglyLinkedList.java

public class SinglyLinkedList {
    static class Node {
        int data;
        Node next;
        Node(int data) { this.data = data; }
    }

    public static void printList(Node head) {
        Node current = head;
        while (current != null) {
            System.out.print(current.data + " -> ");
            current = current.next;
        }
        System.out.println("NULL");
    }

    public static void main(String[] args) {
        Node head = new Node(10);
        head.next = new Node(20);
        head.next.next = new Node(30);

        printList(head);
    }
}

Output:

10 -> 20 -> 30 -> NULL

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

Satinder Singh Sall πŸ’Ό Full-Stack Developer | Programmer | Code Enthusiast πŸ”— Portfolio πŸ”— GitHub πŸ“§ [email protected]


⭐ Contributing

Contributions are always welcome! To contribute:

  1. Fork the repository 🍴
  2. Create a new branch (feature/your-feature)
  3. Commit your changes
  4. Submit a Pull Request πŸš€

πŸ’‘ "First, solve the problem. Then, write the code." β€” John Johnson