-
To be done after test cases have been added.
If any bugs are found, create a separate issue named ` | | Test Case Failed` and report the failed test case there.
Also report the code which has b…
-
```
llvm-cbe currently outputs a C-like language meant to be compiled by some C compilers.
I'd suggest to make the output more like C, at least unless a known compiler is detected.
For the selection…
-
# super fast sort algorithm in js
> sort algorithm
1. Promise.race (return the fast one)
2. Async / Await
```js
// chrome & fast sort 快速排序
// firefox & merge sort 归并排序
const superFast…
-
Read the file in and sort the word count for each using bubblesort and selectionsort algorithms.
Here is pseudocode for each:
http://www.algorithmist.com/index.php/Bubble_sort
http://www.algorithmi…
-
本周学习了LRU Cache, Bloom Filter, 位运算, 排序
位运算几个重要的公式
n = n & (n - 1) // 打掉最后一个1
n & -n // 拿到最后一个1
本周重点是排序
针对常见的排序, 写了个C++的实现, 如下
#include
#include
#include
#include
using namespace…
-
https://g-ss-hacker.github.io/G-SS-Hacker.github.io/C%E8%AF%AD%E8%A8%80%E5%AE%9E%E7%8E%B0%E9%80%89%E6%8B%A9%E3%80%81%E6%8F%92%E5%85%A5%E3%80%81%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95/
…
-
选择排序(Selection sort) 是一种简单直观的排序算法。
选择排序的主要优点与数据移动有关。
如果某个元素位于正确的最终位置上,则它不会被移动。
选择排序每次交换一对元素,它们当中至少有一个将被移到其最终位置上,因此对 n 个元素的表进行排序总共进行至多 n - 1 次交换。在所有的完全依靠交换去移动元素的排序方法中,选择排序属于非常好的一种。
选择排序的算法步…
-
Implement selection sort.
-
三种简单排序代码:
``` java
public void selectionSort(int[] arr) {
int minIndex;
for (int i = 0; i < arr.length - 1; i++) {
minIndex = i;
f…
-
Add any Cpp code or tricks in the respective folders
Example - Sorting algos in the Sorting folder, etc.