Skip to content

Commit 3efd47c

Browse files
authored
Refactor selection_sort return type
Updated the return type of selection_sort function to simplify it.
1 parent f33af58 commit 3efd47c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎divide_and_conquer/minimum_element_of_array.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from __future__ import annotations
1515

1616
import random
17-
from typing import Any
1817

1918

2019
def partition(array: list, starting_index: int, ending_index: int) -> int:
@@ -66,7 +65,7 @@ def randomized_partition(array: list, starting_index: int, ending_index: int) ->
6665

6766
def selection_sort(
6867
array: list, starting_index: int, ending_index: int, smallest_element: int
69-
) -> list | None | Any:
68+
) -> list | None:
7069
"""
7170
Returns a list of sorted array elements using selection sort.
7271
Using selection to find a minimum is O(n) overkill vs. a linear scan — the

0 commit comments

Comments
 (0)