Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

Algorithm-Visualizer

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"})

▢️ How to Run the Project

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors