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.
✅ 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.
Clone the repository
git clone https://github.com/yourusername/closest-karatsuba-visualizer.gitNavigate to the project folder
cd closest-karatsuba-visualizerOpen index.html in a browser
No additional setup is required; everything runs in the browser.
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