Skip to main content

Search and Sort Modules


Different Search and Sort algorithms are implemented.

For now the functionality is really basic but it should evolve to a collection of several methods for searching elements and / or sorting sequences.

HowTo:

Available Sorting algorithms:
  1. Bubble Sort
  2. Quick Sort
  3. Shell Sort
Available Searching algorithms:

(returns index or False if element not found)

  1. Binary Search
  2. Hashmap
  3. Linear Search
Extra features:

Creating a random array.

  • first parameter: length of array
  • second parameter: range of numbers

Be aware that a tuple is returned, containing the array and a random chosen number of this array.

    
    from SeaSor import SeaSor
    
    SeaSor().get_int_array(length, range)

1.1) also available for ascii array:

    from SeaSor import SeaSor
     
    SeaSor().get_ascii_array(length, charset)
  1. Remove duplicates
    from SeaSor import Search
    
    # For example you want to remove duplicates
    #    before searching the index:
    
    Search().rm_dupls([1,1,2,3])
    
    # Output: [1,2,3]
  1. Write to (and/or Read) file

Following

How to import
  1. find index number of a element in a list (here the binary search method is applied)
    from SeaSor import SeaSor
    
    get_index = SeaSor.Search().bin_index(array, target)

Create an instance

Example:

    from SeaSor import Sort

    x = Sort
    
    # Possible to set parameters for the object
    # Also possible: Sort().quick([2,3,1])
    # Or:            Sort([2,3,1]).quick()
    
    x.array = [2,3,1]
    x.quick(x)

    # Output: [1,2,3]

Available classes
    from SeaSor import SeaSor
    from SeaSor import Sort
    from SeaSor import Search
    from SeaSor import WriteRead
For more informations and instructions visit:

SeaSor Github Repository

Download files

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

Source Distribution

SeaSor-0.1.3.5.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file SeaSor-0.1.3.5.tar.gz.

File metadata

  • Download URL: SeaSor-0.1.3.5.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for SeaSor-0.1.3.5.tar.gz
Algorithm Hash digest
SHA256 2664c0b52673e5b96c9967cf0ef13580c7ac0d7083961301c233182b38932d3f
MD5 22f53ac596c0b43ff7e8db34d71dbb36
BLAKE2b-256 b36ed7bcb7c0c2e2cc5e1e319b6162a9eef0e9fa1c0410921566c1969592608b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3.5 This release

1 file

0.1.3.4

2 files

0.1.3.3

2 files

0.1.3.2

2 files

0.1.3.1

2 files

0.1.3

1 file

0.1.2

1 file

0.1.1

2 files

0.1

2 files

Supported by

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