DSA in Java
This repository supplements our mobile app “VisiGrab: Algorithms & DSA”, which offers interactive visualizations of algorithms and data structures. It provides code for the concepts demonstrated in the app and is an essential resource for users seeking to understand and explore these implementations in detail. Learn more about the app: App Store, Google Play.
Topics Covered
- Big O Notation — one function per growth class: reading by index O(1), binary search O(log n), linear search O(n), and the duplicate check that compares every pair O(n^2)
- Binary Trees — BST (Standard, AVL, Red-Black), In-order / Pre-order / Post-order / Breadth-first traversals
- B-Tree — search, insertion with node splits, deletion with borrowing and merging. The app also features an interactive B-Tree Constructor — add and remove keys, choose how large the nodes may grow, and step through every split, borrow and merge as it happens.
- Graphs — BFS/DFS traversal, Dijkstra, Bellman-Ford, Minimum Spanning Tree (Kruskal, Prim), Topological Sort. The app also features an interactive Graph Constructor — tap to add vertices, drag between them to add edges, and watch the algorithms run on your custom graph in real time.
- Linear Data Structures — Array, Linked List, Stack, Queue
- Min-Heap
- Sorting — Bubble, Insertion, Selection, Merge, Quick (Lomuto & Hoare), Heap Sort
- Hash Table — Chaining, Open Addressing (linear & quadratic probing)
- Trie
- Union-Find
Contributing
While this project is open-source, it is not currently seeking contributions. You are welcome to fork and use the code according to the license, but please note that contributions or pull requests to this repository will not be accepted.
Installation and Setup
To clone and run these examples locally, follow these steps:
git clone https://github.com/Lord-of-Algorithms/DSA-in-Java.git
Usage
All commands must be run from the src/ directory. Every source file declares a package (e.g. package binarytree;), so compiling or running from inside a package subfolder will fail to resolve imports.
cd DSA-in-Java/src
Then compile and run any example. For instance:
javac binarytree/BinarySearchTreeMain.java
java binarytree.BinarySearchTreeMain
Replace the path and class name with any other *Main class — they all follow the same pattern.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Rate the App
If VisiGrab has helped your learning, a quick rating on the App Store or Google Play helps other learners discover it. Thanks!
评论