Welcome to the Data Structures Implementation repository!
This project contains clean, well-structured Java implementations of core data structures that are essential for mastering algorithms.
- Generic Singly Linked-List class (
<E>) - Custom
EmptyListException - Operations
addFirst,addLast,addAtIndex,removeByIndex,removeLast,removeFirst,remove,reverse,isEmpty,get,getFirst,getLast,clear,contains,addAll,size,indexOf - Constructor
default constructor,Iterable,Array toString()to print List contentIteratorsupport for enhancedfor-eachloops- Sample
main()class to test the LinkedList
- Generic Doubly Linked-List class (
<E>) - Custom
EmptyListException - Operations
addFirst,addLast,addAtIndex,remove,removeByIndex,removeFirst,removeLast,contains,indexOf,getFirst,getLast,get,isEmpty,size,clear, addAll - Constructor
default constructor,Iterable toString()to print List contentIteratorsupport for enhancedfor-eachloops- Sample
main()class to test the LinkedList
- Generic circular doubly Linked-List class (
<E>) - Custom
EmptyListException - Operations
addFirst,addLast,addAtIndex,remove,removeByIndex,removeFirst,removeLast,contains,indexOf,getFirst,getLast,get,isEmpty,size,clear, addAll - Constructor
default constructor,Iterable toString()to print List contentIteratorsupport for enhancedfor-eachloops- Sample
main()class to test the LinkedList
- Stack using Object Arrays
- Generic Stack class (
<E>) - Custom
StackEmptyException - Operations
push,pop,isEmpty,peek,size,increaseCapacity toString()method to print stack contentIteratorsupport for enhancedfor-eachloops- Sample
main()class to test the stack - Example
stackproblem
- Stack using Singly Linked-List
- Generic Stack class(
<E>) - Custom
EmptyStackException - Operations
push,pop,isEmpty,peek,size toString()method to print stack contentIteratorsupport for enhancedfor-eachloops- Sample
main()class to test the stack
- Generic Queue class (
<E>) - Operations
enqueue,dequeue,front - Constructor
default constructor toString()to print Queue elements- Sample
main()class to test the Queue
- Generic Queue class(
<E>) - Custom
EmptyQueueException - Operations
enqueue,enqueueAll,dequeue,dequeueAll,peek,isEmpty,size - Constructor
default Constructor,Iterable toStringto print Queue elementsIteratorsupport for enhancedfor-eachloops- Sample
main()class to test the Queue
- Generic Queue class (
<E>) - Custom
EmptyQueueException - Operations
enqueue,enqueueAll,dequeue,dequeueAll,peek,isEmpty,size - Constructor
default Constructor,Iterable toStringto print Queue elementsIteratorsupport for enhancedfor-eachloops- Sample
main()class to test the Queue
- Generic Queue class (
<E>) - Custom
EmptyDequeException - Operations
offerFirst,offerLast,peekFirst,peekLast,pollFirst,pollLast,isEmpty,size - Constructor
default Constructor,Iterable toStringto print Queue elementsIteratorsupport for enhancedfor-eachloops- Sample
main()class to test the Deque
- Generic Queue class (
<E>) - Backed by singly linked list (Node-based implementation)
- Thread-safe with
synchronizedblocks - Uses
Semaphorefor blocking behaviorenqueueSemaphore→ controls available slotsdequeueSemaphore→ controls available items
- Operations:
enqueue(E element),dequeue(),getSize(),isFull(),isEmpty(),peekRear(),peekFront() - Constructor:
default constructor,capacity-based constructor toStringto print Queue elements- Sample
main()class to test multiple producers and consumers
- Generic BinaryTree class(
<E>) with inner node class - Operation
insertRight,insertLeft,inOrderTraversal,preOrderTraversal,postOrderTraversal,levelOrderTraversal,contains,construct - Constructor
Constructor with one parameter to initialize root node , Constructor with parser and root - sample
main()class to test the BinaryTree
- Generic BinarySearchTree class(
<E>) with inner node class - Operation
insert,search,inOrderTraversal,preOrderTraversal,postOrderTraversal,levelOrderTraversal,contains,delete - Constructor
defaut constructor,constructor with on parameter to initialize root node - sample
main()class to test the BinarySearchTree