PEP style and tree traversals

This commit is contained in:
Akshay Sharma
2016-09-26 02:45:14 +05:30
parent 0c409f37e9
commit 9deae5d14c
7 changed files with 115 additions and 15 deletions

View File

@ -17,7 +17,7 @@ def selection_sort(collection):
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> selection_sort([0, 5, 3, 2, 2])
@ -29,7 +29,7 @@ def selection_sort(collection):
>>> selection_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
least = i