Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Karatsuba-Closest-Pair-Visualizer

Overview

This project is a web-based visualization tool for two well-known divide-and-conquer algorithms: Closest-Pair Algorithm: Identifies the closest pair of points in a 2D plane efficiently with a time complexity of O(n log n), an improvement over the brute-force O(n²) method. Karatsuba Algorithm: Performs fast long-integer multiplication with a time complexity of O(n¹.⁵⁸⁵), compared to the traditional brute-force O(n²) method. The project helps users understand these algorithms by providing an interactive visual representation of their execution.

Features

✅ Interactive Visualization: Step-by-step execution of both algorithms.

✅ Closest-Pair Algorithm: Plots points dynamically and illustrates how pairs are checked.

✅ Karatsuba Algorithm: Shows two variations—detailed step-by-step breakdown and tree visualization.

✅ Web-Based: Implemented using JavaScript, HTML, and CSS, with animations for better understanding.

How to Run the Project

Clone the repository

git clone https://github.com/yourusername/closest-karatsuba-visualizer.git

Navigate to the project folder

cd closest-karatsuba-visualizer

Open index.html in a browser

No additional setup is required; everything runs in the browser.

Usage

Closest-Pair Algorithm

Add random points on the canvas.

Start the visualization to see how the algorithm finds the closest pair.

Watch how pairs are checked and the minimum distance is computed.

Karatsuba Algorithm

Enter two large numbers.

Choose between step-by-step calculation or tree visualization.

Observe how the multiplication is performed efficiently.

Author: Ammar Hyder

About

A web-based visualizer for Karatsuba and Closest-Pair algorithms. Watch step-by-step animations to understand how fast multiplication and closest point detection work. Built with HTML, CSS, and JavaScript. Perfect for learning divide-and-conquer algorithms interactively.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages