mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Adding unit tests for sorting functions, and improving readability on some sorting algorithms (#784)
* Adding variable to fade out ambiguity * More readability on merge sorting algorithm * Updating merge_sort_fastest description and explaining why * Adding tests file with imports * Standardazing filenames and function names * Adding test cases and test functions * Adding test loop * Putting 'user oriented code' inside main condition for having valid imports * Fixing condition * Updating tests: adding cases and todo list * Refactoring first euler problem's first solution
This commit is contained in:
@ -30,7 +30,7 @@ def inorder(root, res):
|
||||
res.append(root.val)
|
||||
inorder(root.right,res)
|
||||
|
||||
def treesort(arr):
|
||||
def tree_sort(arr):
|
||||
# Build BST
|
||||
if len(arr) == 0:
|
||||
return arr
|
||||
@ -42,4 +42,5 @@ def treesort(arr):
|
||||
inorder(root,res)
|
||||
return res
|
||||
|
||||
print(treesort([10,1,3,2,9,14,13]))
|
||||
if __name__ == '__main__':
|
||||
print(tree_sort([10,1,3,2,9,14,13]))
|
||||
|
Reference in New Issue
Block a user