Adopted by ACM council 10/16/92.
1992년 10월 16일에 ACM 위원회에 의해 적용됨.
Preamble
#!/usr/bin/env node | |
// | |
// Count the number of comparisons required by quicksort using the following | |
// three pivot-selection strategies: | |
// | |
// 1. Always pick the first element. | |
// 2. Always pick the last element. | |
// 3. Pick the median of the first, last, and middle elements. If the list | |
// length is even, pick the element with the smaller index. | |
// |
let count = 0; | |
function shuffle(array) { | |
var currentIndex = array.length, temporaryValue, randomIndex; | |
// While there remain elements to shuffle... | |
while (0 !== currentIndex) { | |
// Pick a remaining element... | |
randomIndex = Math.floor(Math.random() * currentIndex); |
let count = 0; | |
/** | |
* An implementation for Mergesort. Less efficient | |
* than Quicksort. Again, you'd just use Array.sort | |
* but if you found yourself unable to use that | |
* there's always this option. | |
* | |
* Tests with: | |
* | |
* var array = []; |
# 0. Get official distribution. Substitue 'x' with desired version. | |
sudo apt-get install python3.x | |
# 1. Get all installed python3 distributions | |
ls -alh /usr/bin | grep python3 | |
# 2. Add installed python3 version to update-alternatives | |
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.x | |
# 3. Configure update-alternatives. |