Algorithm-Visualizer-GUVI-HCL is a Java-based project developed as part of the GUVI HCL Capstone Program. The main goal of this project is to help users understand how algorithms work internally by providing step-by-step visualization, data manipulation, and performance comparison. The project uses Java, JavaFX, and MongoDB, along with CRUD operations to manage datasets.
This application is designed for students and developers who want to learn algorithms practically rather than just theoretically.
π Project Overview
This project allows users to:
Visualize algorithm steps in real time
Store and manage datasets using MongoDB
Perform CRUD operations on datasets
Compare different algorithms based on execution time
Understand how sorting and searching algorithms work internally
Add new algorithms easily using a modular architecture
The project is built with clean code structure, making it easy to extend and maintain.
π Features πΉ Algorithm Visualization
The system visualizes algorithm execution step-by-step. You can observe:
Comparisons
Swaps
Merges
Movements of elements
This helps in understanding how each algorithm processes the dataset.
πΉ CRUD Operations (MongoDB)
The application supports:
Create new datasets
Read existing datasets
Update dataset values
Delete unwanted datasets
All datasets are stored inside MongoDB for persistence.
πΉ Efficiency Comparison
The execution time of each algorithm is measured and displayed. This feature helps users understand:
Which algorithm performs faster
How input size affects performance
πΉ MongoDB Integration
The project uses:
MongoDB Java Driver
MongoDB Compass for GUI-based viewing
MongoDB Shell (mongosh) for command-line testing
πΉ Modular & Scalable
New algorithms, datasets, and visual components can be added with minimal changes.
π οΈ Technologies Used
Java 17+
JavaFX (GUI and visualization)
MongoDB (Data storage)
MongoDB Java Driver
MongoDB Compass & Shell
Data Structures and Algorithms
π Project Structure Algorithm-Visualizer-GUVI-HCL/ β βββ src/ β βββ main/java/com/algorithmvisualizer/ β β βββ Main.java β β βββ gui/ # JavaFX UI components β β βββ algorithms/ # Algorithm implementations β β βββ models/ # Data models β β βββ database/ # MongoDB connection + DAO classes β β βββ utils/ # Timer and helper classes β βββ lib/ # External JARs (MongoDB driver, JavaFX) βββ resources/datasets/ # Sample dataset files βββ README.md βββ .gitignore
ποΈ MongoDB Setup & Usage Start MongoDB mongod
Open MongoDB Shell mongosh use AlgoDB
Example CRUD commands
Insert dataset:
db.datasets.insertOne({ name: "example", data: [10, 3, 6, 1, 15] })
Find dataset:
db.datasets.find()
Update dataset:
db.datasets.updateOne({name: "example"}, {$set: {data: [1,2,3,4]}})
Delete dataset:
db.datasets.deleteOne({name: "example"})
Install JDK 17+
Install MongoDB Community Server
Install MongoDB Compass
Add all JAR files inside /lib to your Java build path
Start MongoDB using mongod
Open the project in IntelliJ/Eclipse/VS Code
Run Main.java
This will launch the JavaFX application.
π§ͺ Sample Code Snippets Inserting a dataset using Java DatasetDAO dao = new DatasetDAO(); dao.createDataset( new Document("name", "numbers") .append("data", Arrays.asList(5, 2, 8, 1, 9)) );
Comparing algorithms long bubbleTime = Timer.measure(new BubbleSort(), dataset); long mergeTime = Timer.measure(new MergeSort(), dataset);
System.out.println("Bubble Sort Time: " + bubbleTime + " ns"); System.out.println("Merge Sort Time: " + mergeTime + " ns");
π Algorithms Included β Implemented:
Bubble Sort
Merge Sort
β Planned for future:
Quick Sort
Selection Sort
Insertion Sort
Linear Search
Binary Search
πΈ Screenshots
Home Screen
Visualization screen
CRUD operations
MongoDB views
π€ Contributing
Contributions and improvements are welcome. Feel free to submit issues or pull requests.