This repository contains implementations of various data structures and solutions to coding problems, primarily from LeetCode. It serves as a comprehensive collection of fundamental computer science concepts and algorithmic problem-solving techniques.
- BinaryTree.java - Binary tree implementation with basic operations
- CircularLinkedList.java - Circular linked list implementation
- DoublyLinkedList.java - Doubly linked list with forward and backward traversal
- singlyLinkedList.Java - Basic singly linked list implementation
- Queue.java - Queue data structure implementation
- Stack.java - Stack implementation with standard operations
- StackUsingArray.java - Array-based stack implementation
- NextGreaterElement.java - Finding next greater element in arrays
- ReverseStringInStack.java - String reversal using stack
The Leetcode/
folder contains solutions to various LeetCode problems organized by categories:
- Two Sum, Three Sum
- Best Time to Buy and Sell Stock (I & II)
- Move Zeroes, Rotate Array
- Valid Palindrome, Valid Anagram
- Group Anagrams, First Unique Character
- And many more...
- Reverse Linked List
- Remove Nth Node from End
- Delete Middle Node
- Merge K Sorted Lists
- In-order, Pre-order, Post-order Traversals
- Tree node implementation
- Find Smallest Letter Greater Than Target
This repository is written in Java. To run any of the implementations:
- Clone the repository
- Compile the Java files using
javac
- Run the desired program using
java
Example:
javac BinaryTree.java
java BinaryTree
This repository serves as:
- A reference for common data structure implementations
- Practice solutions for coding interviews
- Study material for algorithms and data structures
- A collection of LeetCode problem solutions with explanations
Feel free to add more data structure implementations or LeetCode solutions. Make sure to follow consistent coding style and add appropriate comments.
Each implementation focuses on clarity and educational value, making it easy to understand the underlying concepts and algorithms.