Skip to content

A Java Data Structures and Algorithms repository for quick revision, practice, and reference.

License

Notifications You must be signed in to change notification settings

itsjomon/java-dsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

eae23ee · Mar 28, 2025

History

4 Commits
Mar 20, 2025
Mar 8, 2025
Mar 28, 2025

Repository files navigation

Java Data Stractures and Algorithm

Welcome to my Java Data Structures & Algorithms progress repository! This repository serves as a collection of my notes, code, and problem-solving progress to aid in revision and preparation for interviews.

What is Java?

Java is a high-level, object-oriented programming language known for its platform independence (Write Once, Run Anywhere). It is widely used for building applications, from web to mobile and enterprise systems.

How to Set Up Java

1. Install Java (JDK)

To run Java programs, you need to install the Java Development Kit (JDK). You can download it from:

After installation, verify it using:

java -version
javac -version

2. Set Up Java Environment Variables (if needed)

On Windows:
Add JAVA_HOME and PATH environment variables pointing to the JDK installation directory.

On macOS/Linux:

  export JAVA_HOME=/path/to/jdk
  export PATH=$JAVA_HOME/bin:$PATH

How to Create a Java File and Project

Creating a Java File Manually

  1. Open a text editor or IDE.
  2. Create a new file with a .java extension. Example: Main.java.
  3. Write your Java code inside the file.

Creating a Java Project Using an IDE

  • IntelliJ IDEA: File -> New Project -> Java
  • Eclipse: File -> New -> Java Project
  • VS Code: Install the Java Extension Pack and create a .java file.

Compiling and Running Java Programs

Using Command Line

  1. Navigate to the directory containing your .java file:
cd /path/to/your/file
  1. Compile the Java file:
javac Main.java
  1. Run the compiled Java program:
java Main

Running Java Code in an IDE

  • Press Run or Shift + F10 (IntelliJ)
  • Click Run in Eclipse or VS Code

Java Boilerplate Code

Every Java program must have a class and a main method. Here's the basic structure:

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, Java!");
    }
}

Java Output Example:

Hello, Java!

Java Features

  • Object-Oriented: Uses classes and objects.
  • Platform Independent: Runs on JVM across different OS.
  • Memory Management: Uses garbage collection.
  • Multithreading: Supports concurrent execution.
  • Secure: Strong security features.

Useful Java Commands

  • Check Java version:
      java -version
  • Compile multiple Java files:
    javac *.java
  • Run a Java program:
    java ClassName
  • Generate Java documentation:
    javadoc -d docs Main.java
    

Repository Structure

  • Each topic is organized in a separate folder for simplicity.
  • Files are named to match the topic name for easy identification.

Repository Overview

Topics covered (Links will be updated as files are added to the repository):

Main Topics DSA Practice
Flowcharts & Pseudocodes Practice Section 1
Variables & Data Types Practice Section 2
Operators Practice Section 3
Conditional Statements Practice Section 4
Loops (Flow Control Practice Section 5
Patterns (Part 1) Practice Section 6
Functions & Methods Practice Section 7
Patterns (Part 2) - Advanced Practice Section 8
Arrays (Part 1) Practice Section 9
Arrays (Part 2) Practice Section 10
Basic Sorting Algorithms Practice Section 11
2D Arrays Practice Section 12
Strings Practice Section 13
Bit Manipulation Practice Section 14
Object Oriented Programming (OOP) Practice Section 15
Recursion Basics (Part 1) Practice Section 16
Recursion Basics (Part 2) Practice Section 17
Divide & Conquer Practice Section 18
Time & Space Complexity Practice Section 19
Backtracking Practice Section 20
ArrayLists Practice Section 21
Linked Lists (Part 1 Practice Section 22
Linked Lists (Part 2 Practice Section 23
Stacks (Part 1) Practice Section 24
Stacks (Part 2) Practice Section 25
Queues Practice Section 26
Greedy Algorithms Practice Section 27
Binary Trees (Part 1) Practice Section 28
Binary Trees (Part 2) Practice Section 29
Binary Trees (Part 3) Practice Section 30
Binary Search Trees (Part 1) Practice Section 31
Binary Search Trees (Part 2) Practice Section 32
Heaps Practice Section 33
Hashing Practice Section 34
Tries Practice Section 35
Graphs (Part 1) Practice Section 36
Graphs (Part 2) Practice Section 37
Practice Section 38
Practice Section 39
Practice Section 40
Practice Section 41
Practice Section 42
Practice Section 43
Practice Section 44
Practice Section 45
Practice Section 46
Practice Section 47
Practice Section 48
Practice Section 49
Practice Section 50

🌟 Don’t Forget to Star!

If you find this repo useful, please consider giving it a star ⭐. It helps others discover it too!

About

A Java Data Structures and Algorithms repository for quick revision, practice, and reference.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published