Skip to content

mmhqs/simultaneous-min-max-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Simultaneous Min. Max. Algorithm

This repo presents a Python implementation of the Simultaneous Minimum and Maximum algorithm.

This algorithm is an efficient technique for finding the minimum and maximum values in a array, optimizing the number of comparisons.

1. The recursion behind the algorithm

2. How to run the project in Python ๐Ÿ

3. Algorithm analyses

The recursion behind the algorithm

To understand the recursion behind the algorithm, I did some studying and compiled my research in the min-max-study file.

After studying the algorithm a little, I implemented the algorithm in Python. I also added comments to the code to make it easier to understand each step of the algorithm.


How to run the project in Python ๐Ÿ

The Simultaneous Min Max algorithm, implemented in Python, can be found in main.py file. You can download it if you want to run it on your computer.

This guide assumes you already have Python installed on your computer, ok? โœ…

Step 1: open your terminal ๐Ÿ–ฅ๏ธ

First, you need to open a command-line interface.

Step 2: navigate to the correct folder ๐Ÿ“‚

You must tell the terminal where your main.py file is located. You'll use the cd (change directory) command for this. Find the path to the folder containing the main.py file you downloaded from this repo.

Type cd followed by a space and the path to your folder. Example:

cd Folder1/Folder2/Folder3/MyProject

Step 3: run the file โ–ถ๏ธ

Once you are in the correct folder, you can run the Python script. Type python followed by the name of your file. Example:

python main.py

Enjoy your numbers!


Algorithm analysis

After studying the algorithm and implementing the code in Python, it is time to understand the complexity of the algorithm! You can find the full analysis in the min-max-analysis file.

About

This repo presents a Python implementation of the Simultaneous Minimum and Maximum algorithm.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages