Skip to content

Latest commit

 

History

History
85 lines (61 loc) · 3.5 KB

File metadata and controls

85 lines (61 loc) · 3.5 KB

Data Structures & Algorithms – By Sparsh Sharma

A structured, hands-on repository of common DSA concepts, solved coding problems, and core logic building. Ideal for students and interview preparation.


📘 What You’ll Learn from This Repository

Topic Covered Content Why it’s Useful
Arrays Basics, 2D arrays, sliding window, prefix sums, Kadane’s, etc. Foundation for all other DSA problems.
Strings Palindromes, anagrams, character frequency, pattern matching Frequently asked in coding rounds.
Linked Lists Singly, doubly, reversal, cycle detection Important for pointer-based logic.
Stacks & Queues Balanced parentheses, infix-postfix, LRU cache Great for parsing and memory problems.
Recursion & Backtracking Factorials, permutations, N-Queens Builds problem-solving intuition.
Binary Trees & BST Traversals, height, diameter, lowest common ancestor Common in system design & tech interviews.
Hashing HashMap, HashSet, frequency maps, custom hashing Crucial for O(1) lookups & optimization.
Searching & Sorting Binary search, merge sort, quicksort Core algorithms asked everywhere.
Graphs DFS, BFS, shortest path (Dijkstra, Bellman-Ford), union-find Advanced problems & CP foundations.
Dynamic Programming 0/1 Knapsack, LIS, LCS, memoization Must-have skill for FAANG-level interviews.

🗂️ Suggested Folder Structure

data-structure-and-algorithm/ ├── 01_arrays/ ├── 02_strings/ ├── 03_linked_lists/ ├── 04_stacks_queues/ ├── 05_recursion_backtracking/ ├── 06_trees_bst/ ├── 07_hashing/ ├── 08_sorting_searching/ ├── 09_graphs/ ├── 10_dynamic_programming/ └── 11_interview_questions/

yaml Copy Edit

Each folder contains:

  • ✅ Concept notes (in .md format)
  • 🧠 Solved problems with comments
  • 🧪 Sample test cases (where applicable)

🚀 Getting Started

# Clone the repository
git clone https://github.com/sparshsharma81/DATA-STRUCTURE-AND-ALGORITHM.git
cd DATA-STRUCTURE-AND-ALGORITHM

# Open any topic folder and run `.java` files with your favorite IDE or terminal
Make sure you have Java 8 or higher installed. Some code uses Java Collections and lambda expressions.

💡 How to Use
Pick a topic you're weak in (e.g. Strings).

Read the summary markdown inside the folder.

Run and modify the example .java files to understand how it works.

Practice by solving additional problems in the interview_questions/ folder.

Track your progress!

🤝 Contributing
Pull requests are welcome.

Add new problems in the correct folder

Keep filenames descriptive (e.g., LongestPalindrome.java)

Comment your logic for clarity

👋 Author
Sparsh Sharma
Java Developer | Problem Solver | Lifelong Learner
LinkedIn · Portfolio

If this repository helps you, please ⭐ star it, fork it, and share it with others!