Skip to content

mmehwishh/Divide-And-Conquer--Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Divide & Conquer Algorithms Project

DAA Banner

This project demonstrates Divide & Conquer (DAA) techniques in Python through two classic problems:

  1. Closest Pair of Points
  2. Integer Multiplication (Step-by-Step)

It includes both a graphical visualization using matplotlib and interactive file input via Streamlit or a Tkinter GUI.


🔹 Features

1. Closest Pair of Points

  • Upload a text file containing 2D points.
  • Computes the closest pair of points using a Divide & Conquer algorithm.
  • Efficient O(n log n) implementation.
  • Visualizes all points and highlights the closest pair.
  • Shows computation time.

2. Integer Multiplication

  • Upload two files containing integers (one per line).
  • Performs multiplication step-by-step, showing partial products.
  • Visualizes results with bar charts.
  • Calculates and displays total execution time.
  • Supports both CLI and GUI interfaces.

⚙️ Installation

  1. Clone the repository:
  2. Install dependencies: pip install -r requirements.txt Dependencies include: streamlit matplotlib numpy Usage Run with Streamlit (Recommended) streamlit run main.py Use the sidebar to select the algorithm.

Upload input files to run algorithms interactively.

View results, charts, and execution time. Run via CLI Closest Pair of Points python backend/closest_pair.py --file <input_file.txt> Integer Multiplication python backend/integer_mult.py --file1 <file1.txt> --file2 <file2.txt> Run GUI Mode python backend/closest_pair.py --gui python backend/integer_mult.py --gui 📝 Input File Format Closest Pair

Text file with 2D points:

5 1 2 3 4 -1 0 2 2 4 1

First line can optionally be the number of points.

Integer Multiplication

Each file contains integers, one per line:

123 456 789 📊 Screenshots Closest Pair Visualization

Integer Multiplication Steps & Chart

🔹 Key Concepts Demonstrated

Divide & Conquer Algorithms

File I/O and Data Parsing

Graphical Visualization with Matplotlib

Interactive GUI & Web App with Tkinter & Streamlit

Step-by-step integer multiplication algorithm

Performance Analysis (execution time measurement)

💻 Author

Arwa Abbas Mehwish Zehra Areeza

About

mplementation and visualization of classic Divide & Conquer algorithms in Python, including Closest Pair of Points and Step-by-Step Integer Multiplication. Interactive GUI and Streamlit support for data analysis and algorithm visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages