Skip to content

Suhas-Bharti/DSA-in-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA in Java

A well-structured collection of Data Structures and Algorithms (DSA) problems implemented in Java.

This repository contains commonly asked coding interview problems organized by algorithmic patterns and problem-solving techniques. The goal of this repository is to practice DSA systematically and build strong problem-solving skills for technical interviews.


Repository Structure

Arrays

Problems based on array traversal, subarrays, and optimization techniques.

Topics covered:

  • Two Sum
  • Best Time to Buy and Sell Stock
  • Print All Pairs in Array
  • Print All Subarrays
  • Maximum Subarray Sum (Brute Force)
  • Maximum Subarray Sum (Prefix Sum)
  • Kadane’s Algorithm

📁 Folder: Arrays


Searching

Problems based on searching algorithms.

Linear Search

Basic searching technique where elements are checked sequentially.

Topics covered:

  • Basic Linear Search
  • Find Largest Element in Array

📁 Folder: Linear-Search

Binary Search

Efficient searching technique used on sorted arrays.

Topics covered:

  • Basic Binary Search
  • First Occurrence in Sorted Array
  • Last Occurrence in Sorted Array
  • Count Occurrences in Sorted Array
  • Search in Rotated Sorted Array

📁 Folder: Binary-Search


Two Pointers

Problems solved using the Two Pointer technique, commonly used for arrays and strings.

Topics covered:

  • Reverse Array using Two Pointers

📁 Folder: Two-Pointers


Sliding Window

Optimized technique used for subarray and substring problems.

Examples include:

  • Maximum Sum Subarray of Size K
  • Longest Substring Without Repeating Characters

📁 Folder: Sliding-Window


Sorting

Implementation of common sorting algorithms.

Algorithms included:

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort

📁 Folder: Sorting


Concepts Covered

  • Arrays
  • Searching Algorithms
  • Sorting Algorithms
  • Two Pointer Technique
  • Sliding Window Technique
  • Time Complexity Optimization

How to Run the Code

  1. Clone the repository
git clone https://github.com/Suhas-Bharti/DSA-in-Java.git
  1. Navigate to the project directory
cd DSA-in-Java
  1. Compile any Java file
javac FileName.java
  1. Run the program
java FileName

Goals of This Repository

  • Strengthen problem-solving skills
  • Practice common coding interview questions
  • Understand algorithmic patterns
  • Build a structured DSA learning path

Author

Suhas Bharti


⭐ If you find this repository helpful, consider giving it a star.

About

Data Structures and Algorithms implemented in Java for coding interview preparation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages