Commit Graph

2 Commits (9d35a9e42cf61a706f00f67aff389e38a8f3858b)

Author SHA1 Message Date
Christian Clauss 2a8185f159
Add Python doctests to count-inversions.py (#159)
* Add Python doctests to count-inversions.py

These [doctests](https://docs.python.org/3/library/doctest.html) can be run with `python3 -m doctest -v count-inversions.py`

Our GitHub Actions will also run these doctests.  https://github.com/MakeContributions/DSA/actions

The answer to the last test should be 0, not 2.

@atin Your review please.

* Avoid unnecessary inversions
2021-04-12 06:03:47 -04:00
Atin Bainada feb6dc99be
added algo to count inversions in an array in C++, Python, JavaScript and Java (#79)
* algo to count inversions in array

Added in C++, Python, JavaScript and Java

* Added comments

* Rename arrays/javascript/count-inversions.js to arrays/js/count-inversions.js

* Update count-inversions.cpp

* Update count-inversions.java

* Update count-inversions.js

* Update count-inversions.py
2021-02-23 16:14:09 -04:00