mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-22 16:31:15 -04:00
👾
This commit is contained in:
parent
1d44d182e2
commit
a85ed914d3
320 changed files with 0 additions and 0 deletions
37
sorting/README.md
Normal file
37
sorting/README.md
Normal file
|
@ -0,0 +1,37 @@
|
|||
## sorting and searching
|
||||
|
||||
<br>
|
||||
|
||||
* **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, then `a` appears before `b`. it does not work if a graph has cycles or is not directed.
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
----
|
||||
|
||||
### `sorting_algorithms.py`
|
||||
|
||||
<br>
|
||||
|
||||
```python
|
||||
> 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]
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### `binary_search.py`
|
||||
|
||||
<br>
|
||||
|
||||
```python
|
||||
> python binary_search.py
|
||||
Recursive: 6
|
||||
Iterative: 6
|
||||
```
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue