-
## Merge Sort
## Quick Sort
## Selection Sort
The solution is: 每次for-loop找到最小值的**位置**,然后与其实位置进行交换。
- The first attempt
```java
public void selectionSort(intp[] array) {
if (array == null…
-
-
### 冒泡排序(Bubble Sort)
```
def bubbleSort(arr):
length = len(arr)
for i in range(length - 1):
for j in range(length - 1 - i):
if arr[j] > arr[j + 1]:
…
-
We're getting `QueryExecutionError:\njava.lang.ArrayIndexOutOfBoundsException` while executing below query:
```sql
SELECT name as key_col, COUNT(*) as val_col
FROM orders
WHERE created_at_seconds …
-
## 第七周 学习总结
时间真的好快啊,第七周了都。。
#### 第一部分 第18课课后作业,手写初级算法
```java
import java.util.Arrays;
import java.util.Random;
public class Sort {
public static void main(String[] args) {
…
-
### 学习笔记
#### 初级排序O(N^2)
**冒泡排序**
```java
public int[] bubbleSort(int[] arr) {
//需要找到length - 1个最大元素
for(int i = 0; i < arr.length - 1; i++) {
//每次需要的比较次数递减
for(int j …
-
本周学习的主要内容是位运算,位运算的进阶LRU Cache和布隆过滤器,以及算法必谈的排序
> 1. 位运算的重点,个人感觉在于通过,按位与,按位或,按位取反,按位异或等几个基础操作的组合,快速获取单个或多个位状态,例如:a&(a-1)消除最低位的1等等
>
> 2. LRU的重点在于了解其实现原理(即是根据最近最少使用原则,通过HashTable和双向链表实现的淘汰算法)和熟悉他们的…
-
After #14270 gets merged, it will add use statements to PrintModuleInitOrder by
necessity, which will modify the order of what gets printed and cause the
modules that it uses to not be printed at al…
-
The extension behaves erratically. If there is no index.html, it will list contents of a directory. If I click on a file, I get an empty page (no page source at all). If I enter the URL of an existing…
-
I am trying to use the junit-quickcheck property testing tool together with Pirtest 1.6.4. However, I am encountering a problem. Pitest doesn't seem to be able to find the tests in my test class.
T…