Skip to main content

A package to find the max and min values using divide and conquer.

Project description

MaxMinConquer

maxminconquer is a Python package that implements divide and conquer algorithms for finding the maximum and minimum values in a list.

Functions

  • find_max(arr, left, right) - Finds the maximum value using divide and conquer.
  • find_min(arr, left, right) - Finds the minimum value using divide and conquer.

Time Complexity

  • Both find_max and find_min functions have a time complexity of O(n) where n is the number of elements in the array. This is because in each step, the array is split into two halves, and the maximum or minimum value is recursively calculated on each half.

Usage

from maxminconquer import find_max, find_min

arr = [1, 2, 3, 4, 10, 90, -4, 5, 65, 87, 78, 98, 41]

max_value = find_max(arr, 0, len(arr) - 1)
print("Maximum value:", max_value)

min_value = find_min(arr, 0, len(arr) - 1)
print("Minimum value:", min_value)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maxminconquer-0.1.3.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maxminconquer-0.1.3-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file maxminconquer-0.1.3.tar.gz.

File metadata

  • Download URL: maxminconquer-0.1.3.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for maxminconquer-0.1.3.tar.gz
Algorithm Hash digest
SHA256 27238738187051e75ecc8ed83488a8cb0f3d0b8f13e11e2afd2aa3819b59119a
MD5 18d9dfbafa9991f09d22e21ea5cf1d19
BLAKE2b-256 aa8689a4d7dabc7bf2e6d3d5b141735c856eed8db63a5cd4f88068932fc83e61

See more details on using hashes here.

File details

Details for the file maxminconquer-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: maxminconquer-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for maxminconquer-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a734aff83d727fa3db261952dbae3fd95c3a1553bcddddc1c6ec442e235e632e
MD5 095a25900e884b010dd74ba62e20b0ca
BLAKE2b-256 4f0ebc8139b6fcaf62e6c1817a252dd436abbdf7eb3127ff81c12d9c54299fa7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page