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

Release files for SeaSor 0.1.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SeaSor 0.1.3.5
File Size Uploaded
SeaSor-0.1.3.5.tar.gz 4.2 kB Details

Release files / SeaSor-0.1.3.5.tar.gz

Download URL SeaSor-0.1.3.5.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2664c0b52673e5b96c9967cf0ef13580c7ac0d7083961301c233182b38932d3f
BLAKE2b-256 checksum
How to use checksums
b36ed7bcb7c0c2e2cc5e1e319b6162a9eef0e9fa1c0410921566c1969592608b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.3.5 This release

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page