quicksortpy 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: quicksortpy
3
+ Version: 0.1.0
4
+ Summary: A simple quicksort implementation
5
+ Author: RapidDragon2612
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+
9
+ The QuickSortPy library (by RapidDragon2612) is a working python implementation of the quick sort algorithm.
10
+ Quick sort is widely considered to be the fastest and most efficient sorting algorithm.
11
+
12
+ To use QuickSortPy, run:
13
+
14
+ import quicksortpy
15
+
16
+ And then use the quicksortpy.sort() function, with the argument of the array which is to be sorted:
17
+
18
+ quicksortpy.sort(example_array)
19
+
20
+ This modifies the original array, but also returns the array as an output which can be used like so:
21
+
22
+ sorted_array = quicksortpy.sort(original_array)
@@ -0,0 +1,14 @@
1
+ The QuickSortPy library (by RapidDragon2612) is a working python implementation of the quick sort algorithm.
2
+ Quick sort is widely considered to be the fastest and most efficient sorting algorithm.
3
+
4
+ To use QuickSortPy, run:
5
+
6
+ import quicksortpy
7
+
8
+ And then use the quicksortpy.sort() function, with the argument of the array which is to be sorted:
9
+
10
+ quicksortpy.sort(example_array)
11
+
12
+ This modifies the original array, but also returns the array as an output which can be used like so:
13
+
14
+ sorted_array = quicksortpy.sort(original_array)
@@ -0,0 +1,13 @@
1
+ [project]
2
+ name = "quicksortpy"
3
+ version = "0.1.0"
4
+ description = "A simple quicksort implementation"
5
+ readme = "README.md"
6
+ requires-python = ">=3.8"
7
+ authors = [
8
+ { name = "RapidDragon2612" }
9
+ ]
10
+
11
+ [build-system]
12
+ requires = ["setuptools>=61.0"]
13
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,3 @@
1
+ from .quick_sort import sort
2
+
3
+ __all__ = ["sort"]
@@ -0,0 +1,25 @@
1
+ def partition(arr, low, high):
2
+ pivot = arr[high]
3
+
4
+ swap_idx = low - 1
5
+
6
+ for curr_idx in range(low, high):
7
+ if arr[curr_idx] <= pivot:
8
+ swap_idx += 1
9
+ arr[swap_idx], arr[curr_idx] = arr[curr_idx], arr[swap_idx]
10
+
11
+ arr[swap_idx + 1], arr[high] = arr[high], arr[swap_idx + 1]
12
+
13
+ return swap_idx + 1
14
+
15
+
16
+ def sort(arr, low=0, high=None):
17
+ if high is None:
18
+ high = len(arr) - 1
19
+
20
+ if not low >= high:
21
+ pivot_idx = partition(arr, low, high)
22
+ sort(arr, pivot_idx + 1, high)
23
+ sort(arr, low, pivot_idx - 1)
24
+
25
+ return arr
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: quicksortpy
3
+ Version: 0.1.0
4
+ Summary: A simple quicksort implementation
5
+ Author: RapidDragon2612
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+
9
+ The QuickSortPy library (by RapidDragon2612) is a working python implementation of the quick sort algorithm.
10
+ Quick sort is widely considered to be the fastest and most efficient sorting algorithm.
11
+
12
+ To use QuickSortPy, run:
13
+
14
+ import quicksortpy
15
+
16
+ And then use the quicksortpy.sort() function, with the argument of the array which is to be sorted:
17
+
18
+ quicksortpy.sort(example_array)
19
+
20
+ This modifies the original array, but also returns the array as an output which can be used like so:
21
+
22
+ sorted_array = quicksortpy.sort(original_array)
@@ -0,0 +1,8 @@
1
+ README.md
2
+ pyproject.toml
3
+ quicksortpy/__init__.py
4
+ quicksortpy/quick_sort.py
5
+ quicksortpy.egg-info/PKG-INFO
6
+ quicksortpy.egg-info/SOURCES.txt
7
+ quicksortpy.egg-info/dependency_links.txt
8
+ quicksortpy.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ quicksortpy
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+