This repository serves as an educational bridge translating classic theoretical Data Structures & Algorithms (DSA) literature into strictly typed Java 11 architectures. It focuses on taking academic pseudo-code and transforming it into functional, Object-Oriented memory management systems.
A major friction point for engineers studying theoretical textbooks (e.g., Robert Lafore's algorithms) is that the textbook code is often outdated or written in pseudo-code that lacks modern architectural boundaries. This repository solves that gap by providing a modern, compile-ready Java implementation of classic data structures, ensuring that theoretical algorithms actually function in a strict JVM environment.
- Literature Translation: Applied programmatic execution of theoretical concepts parsed directly from classical Data Structures literature.
- Strict OOP Abstractions: Decouples core mechanics via Object-Oriented interfaces rather than utilizing flat scripting.
-
Node-Level Memory Mechanics: Explicit generic
Node<T>classes demonstrating safe memory pointer manipulation for multiple linked-list architectures (Singly, Doubly, Circular). -
Time Complexity Matrices: Mathematical proofs establishing execution speed bounds (
$O(N)$ vs $O(1)$) implemented as explicit code commentary.
graph TD
Root[Java Foundations Archive] --> Literature[Theoretical Concepts]
Literature --> Impl[Concrete Java Implementations]
Impl --> Linear[Linear Memory]
Impl --> NonLinear[Hierarchical Memory]
Linear --> Arrays[O N Array Operations]
Linear --> LL[O 1 Head Pointer Nodes]
NonLinear --> Trees[Binary Search Trees]
- Language: Java (JDK 11+)
- Testing: Python
unittest(Javac Wrapper) - Documentation: GitHub Flavored Markdown (GFM)
java-dsa-foundations/
├── src/
│ ├── _1_TimeComplexity/ # Asymptotic analysis proofs
│ ├── _3_SinglyLinkedList/ # Linear linked node mechanics
│ ├── _6_Stacks/ # LIFO array/node wrappers
│ └── Library_*/ # Reusable foundational core interfaces
├── tests/ # Automated compilation verification
└── README.md # System documentation
Ensure the Java Development Kit (JDK) is installed natively on your OS.
git clone https://github.com/krsna016/java-dsa-foundations.git
cd java-dsa-foundations/srcCompile and execute the specific driver class directly, mapping the sourcepath to resolve cross-package dependencies:
javac -sourcepath . _3_SinglyLinkedList/Main.java
java _3_SinglyLinkedList.MainExample interface mapping for constant-time complexity implementations:
// Encapsulating core logic to guarantee O(1) Head Operations
public class SinglyLinkedList {
private Node head;
public void insert(int data) {
Node newNode = new Node(data);
newNode.next = head;
head = newNode;
}
}Note
Educational algorithms execute via standard terminal output without GUI interactions.
Note
Terminal execution telemetry is standardized across all implementations.
We utilize a dynamic Python subprocess wrapper to programmatically test javac compilation across all Java packages concurrently. This ensures that the deep package-level inheritance and interface contracts compile cleanly without missing dependencies.
python3 -m unittest discover tests/- Garbage Collection Optimization: The underlying code is structured to ensure that deleted nodes explicitly release their memory references, preventing the JVM Garbage Collector from encountering memory leaks during continuous execution loops.
- Maven/Gradle Integration: Refactor the repository to utilize a standard
pom.xmlorbuild.gradlefile, allowing native integration of JUnit 5 testing frameworks rather than relying on subprocess wrappers.
This repository is primarily for personal reference and academic archival.
Licensed under the MIT License.