core-algorithms 1.2.0__tar.gz → 1.2.2__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.
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/PKG-INFO +8 -4
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/README.rst +4 -0
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms/__init__.py +1 -5
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms/sorting/__init__.py +0 -3
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms/sorting/bubble_sort.py +2 -6
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms/sorting/insertion_sort.py +1 -5
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms/sorting/merge_sort.py +6 -9
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms/sorting/quick_sort.py +3 -7
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms/sorting/selection_sort.py +1 -5
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms.egg-info/PKG-INFO +8 -4
- core_algorithms-1.2.2/core_algorithms.egg-info/requires.txt +4 -0
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/pyproject.toml +5 -6
- core_algorithms-1.2.2/setup.py +5 -0
- core_algorithms-1.2.0/core_algorithms.egg-info/requires.txt +0 -5
- core_algorithms-1.2.0/setup.py +0 -6
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/LICENSE +0 -0
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms/py.typed +0 -0
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms.egg-info/SOURCES.txt +0 -0
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms.egg-info/dependency_links.txt +0 -0
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms.egg-info/top_level.txt +0 -0
- {core_algorithms-1.2.0 → core_algorithms-1.2.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: core-algorithms
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: This project/library contains common algorithms...
|
|
5
5
|
Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
|
|
6
6
|
Maintainer: Alejandro Cora González
|
|
@@ -24,13 +24,13 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.13
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.14
|
|
26
26
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
27
|
+
Classifier: Typing :: Typed
|
|
27
28
|
Requires-Python: >=3.9
|
|
28
29
|
Description-Content-Type: text/x-rst
|
|
29
30
|
License-File: LICENSE
|
|
30
|
-
Requires-Dist: core-tests>=2.1.0
|
|
31
31
|
Provides-Extra: dev
|
|
32
|
-
Requires-Dist: core-dev-tools>=2.
|
|
33
|
-
Requires-Dist: core-tests>=2.
|
|
32
|
+
Requires-Dist: core-dev-tools>=2.1.0; extra == "dev"
|
|
33
|
+
Requires-Dist: core-tests>=2.3.0; extra == "dev"
|
|
34
34
|
Dynamic: license-file
|
|
35
35
|
|
|
36
36
|
core-algorithms
|
|
@@ -41,6 +41,10 @@ focused on sorting.
|
|
|
41
41
|
|
|
42
42
|
===============================================================================
|
|
43
43
|
|
|
44
|
+
.. image:: https://static.pepy.tech/personalized-badge/core-algorithms?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
|
|
45
|
+
:target: https://pepy.tech/projects/core-algorithms
|
|
46
|
+
:alt: PyPI Downloads
|
|
47
|
+
|
|
44
48
|
.. image:: https://img.shields.io/pypi/pyversions/core-algorithms.svg
|
|
45
49
|
:target: https://pypi.org/project/core-algorithms/
|
|
46
50
|
:alt: Python Versions
|
|
@@ -6,6 +6,10 @@ focused on sorting.
|
|
|
6
6
|
|
|
7
7
|
===============================================================================
|
|
8
8
|
|
|
9
|
+
.. image:: https://static.pepy.tech/personalized-badge/core-algorithms?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
|
|
10
|
+
:target: https://pepy.tech/projects/core-algorithms
|
|
11
|
+
:alt: PyPI Downloads
|
|
12
|
+
|
|
9
13
|
.. image:: https://img.shields.io/pypi/pyversions/core-algorithms.svg
|
|
10
14
|
:target: https://pypi.org/project/core-algorithms/
|
|
11
15
|
:alt: Python Versions
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""Common algorithm implementations."""
|
|
4
2
|
|
|
5
|
-
from importlib.metadata import PackageNotFoundError
|
|
6
|
-
from importlib.metadata import version
|
|
7
|
-
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
8
4
|
|
|
9
5
|
try:
|
|
10
6
|
__version__ = version("core-algorithms")
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""Sorting algorithm implementations."""
|
|
4
2
|
|
|
5
3
|
from .bubble_sort import bubble_sort
|
|
@@ -8,7 +6,6 @@ from .merge_sort import merge_sort
|
|
|
8
6
|
from .quick_sort import quick_sort
|
|
9
7
|
from .selection_sort import selection_sort
|
|
10
8
|
|
|
11
|
-
|
|
12
9
|
__all__ = [
|
|
13
10
|
"bubble_sort",
|
|
14
11
|
"insertion_sort",
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""Bubble sort algorithm implementation."""
|
|
4
2
|
|
|
5
|
-
from typing import List
|
|
6
|
-
|
|
7
3
|
|
|
8
|
-
def bubble_sort(array:
|
|
4
|
+
def bubble_sort(array: list):
|
|
9
5
|
"""
|
|
10
|
-
Sort *array* in ascending order using bubble
|
|
6
|
+
Sort *array* in ascending order using bubble
|
|
11
7
|
sort and return it.
|
|
12
8
|
"""
|
|
13
9
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""Insertion sort algorithm implementation."""
|
|
4
2
|
|
|
5
|
-
from typing import List
|
|
6
|
-
|
|
7
3
|
|
|
8
|
-
def insertion_sort(array:
|
|
4
|
+
def insertion_sort(array: list):
|
|
9
5
|
"""
|
|
10
6
|
Sort *array* in ascending order using insertion
|
|
11
7
|
sort and return it."""
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""Merge sort algorithm implementation."""
|
|
4
2
|
|
|
5
|
-
from typing import List
|
|
6
|
-
|
|
7
3
|
|
|
8
|
-
def merge_sort(array:
|
|
4
|
+
def merge_sort(array: list):
|
|
9
5
|
"""
|
|
10
6
|
Sort *array* in ascending order using merge
|
|
11
7
|
sort and return it."""
|
|
@@ -35,10 +31,11 @@ def _merge(left, right, merged):
|
|
|
35
31
|
merged[left_cursor + right_cursor] = right[right_cursor]
|
|
36
32
|
right_cursor += 1
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
# Copy whatever remains on either side...
|
|
35
|
+
for i in range(left_cursor, len(left)):
|
|
36
|
+
merged[i + right_cursor] = left[i]
|
|
40
37
|
|
|
41
|
-
for
|
|
42
|
-
merged[left_cursor +
|
|
38
|
+
for j in range(right_cursor, len(right)):
|
|
39
|
+
merged[left_cursor + j] = right[j]
|
|
43
40
|
|
|
44
41
|
return merged
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""Quick sort algorithm implementation."""
|
|
4
2
|
|
|
5
|
-
from typing import List
|
|
6
|
-
|
|
7
3
|
|
|
8
|
-
def _partition(array:
|
|
4
|
+
def _partition(array: list, begin: int, end: int):
|
|
9
5
|
pivot_idx = begin
|
|
10
6
|
for i in range(begin + 1, end + 1):
|
|
11
7
|
if array[i] <= array[begin]:
|
|
@@ -16,7 +12,7 @@ def _partition(array: List, begin: int, end: int):
|
|
|
16
12
|
return pivot_idx
|
|
17
13
|
|
|
18
14
|
|
|
19
|
-
def _quick_sort_recursion(array:
|
|
15
|
+
def _quick_sort_recursion(array: list, begin: int, end: int):
|
|
20
16
|
if begin >= end:
|
|
21
17
|
return
|
|
22
18
|
|
|
@@ -25,7 +21,7 @@ def _quick_sort_recursion(array: List, begin: int, end: int):
|
|
|
25
21
|
_quick_sort_recursion(array, pivot_idx + 1, end)
|
|
26
22
|
|
|
27
23
|
|
|
28
|
-
def quick_sort(array:
|
|
24
|
+
def quick_sort(array: list, begin=0, end=None):
|
|
29
25
|
"""
|
|
30
26
|
Sort *array* in ascending order using quick
|
|
31
27
|
sort and return it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: core-algorithms
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: This project/library contains common algorithms...
|
|
5
5
|
Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
|
|
6
6
|
Maintainer: Alejandro Cora González
|
|
@@ -24,13 +24,13 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.13
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.14
|
|
26
26
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
27
|
+
Classifier: Typing :: Typed
|
|
27
28
|
Requires-Python: >=3.9
|
|
28
29
|
Description-Content-Type: text/x-rst
|
|
29
30
|
License-File: LICENSE
|
|
30
|
-
Requires-Dist: core-tests>=2.1.0
|
|
31
31
|
Provides-Extra: dev
|
|
32
|
-
Requires-Dist: core-dev-tools>=2.
|
|
33
|
-
Requires-Dist: core-tests>=2.
|
|
32
|
+
Requires-Dist: core-dev-tools>=2.1.0; extra == "dev"
|
|
33
|
+
Requires-Dist: core-tests>=2.3.0; extra == "dev"
|
|
34
34
|
Dynamic: license-file
|
|
35
35
|
|
|
36
36
|
core-algorithms
|
|
@@ -41,6 +41,10 @@ focused on sorting.
|
|
|
41
41
|
|
|
42
42
|
===============================================================================
|
|
43
43
|
|
|
44
|
+
.. image:: https://static.pepy.tech/personalized-badge/core-algorithms?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
|
|
45
|
+
:target: https://pepy.tech/projects/core-algorithms
|
|
46
|
+
:alt: PyPI Downloads
|
|
47
|
+
|
|
44
48
|
.. image:: https://img.shields.io/pypi/pyversions/core-algorithms.svg
|
|
45
49
|
:target: https://pypi.org/project/core-algorithms/
|
|
46
50
|
:alt: Python Versions
|
|
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
|
|
|
9
9
|
[project]
|
|
10
10
|
name = "core-algorithms"
|
|
11
11
|
description = "This project/library contains common algorithms..."
|
|
12
|
-
version = "1.2.
|
|
12
|
+
version = "1.2.2"
|
|
13
13
|
|
|
14
14
|
authors = [
|
|
15
15
|
{name = "Alejandro Cora González", email = "alek.cora.glez@gmail.com"}
|
|
@@ -39,16 +39,15 @@ classifiers = [
|
|
|
39
39
|
"Programming Language :: Python :: 3.13",
|
|
40
40
|
"Programming Language :: Python :: 3.14",
|
|
41
41
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
42
|
+
"Typing :: Typed",
|
|
42
43
|
]
|
|
43
44
|
|
|
44
|
-
dependencies = [
|
|
45
|
-
"core-tests>=2.1.0"
|
|
46
|
-
]
|
|
45
|
+
dependencies = []
|
|
47
46
|
|
|
48
47
|
[project.optional-dependencies]
|
|
49
48
|
dev = [
|
|
50
|
-
"core-dev-tools>=2.
|
|
51
|
-
"core-tests>=2.
|
|
49
|
+
"core-dev-tools>=2.1.0",
|
|
50
|
+
"core-tests>=2.3.0",
|
|
52
51
|
]
|
|
53
52
|
|
|
54
53
|
[project.urls]
|
core_algorithms-1.2.0/setup.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{core_algorithms-1.2.0 → core_algorithms-1.2.2}/core_algorithms.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|