mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-11-18 21:30:10 -05:00
| .. | ||
| bubble_sort.py | ||
| bucket_sort.py | ||
| counting_sort.py | ||
| insertion_sort.py | ||
| merge_sort.py | ||
| README.md | ||
| seletction_sort.py | ||
| sorting_algorithms.py | ||
sorting
-
inversions in a sequence is a pair of elements that are out of order with respect to the ordering relation. a sorting algorithm is a sequence of operations that reduces inversions to zero.
-
a topological sort of a diretect graph is a way of ordering the list of nodes such that if
(a, b)is a edge of the graph, thenaappears beforeb. it does not work if a graph has cycles or is not directed.
some examples in this dir
sorting_algorithms.py
> python3 sorting_algorithms.py
Array: [3, 5, 1, 2, 10, 6]
Testing merge sort: [1, 2, 3, 5, 6, 10]
Testing quick sort: [1, 2, 3, 5, 6, 10]
binary_search.py
> python binary_search.py
Recursive: 6
Iterative: 6