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:
Mehdi ALAOUI
2019-05-25 15:41:24 +02:00
committed by John Law
parent 9f982a83c8
commit 02c0daf9e5
14 changed files with 119 additions and 47 deletions

View File

@ -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]))