2021-08-03
参考:https://baike.baidu.com/item/%E5%B8%8C%E5%B0%94%E6%8E%92%E5%BA%8F/3229428?fr=aladdin
1234567891011121314//希尔排序func shellSort(arr []int) {length := len(arr)for step := lengt...
阅读全文
2021-08-03
1234567891011121314151617181920212223242526272829303132333435//冒泡排序func bubbleSort(arr []int) {length := len(arr)for i := 0; i < length; i++ {for j := 0; j < length...
阅读全文
2021-08-03
排序算法
时间复杂度
空间复杂度
稳定性
排序方式
冒泡排序
O(_n_2)
O(1)
稳定
In-place
选择排序
O(_n_2)
O(1)
不稳定
In-place
插入排序
O(_n_2)
O(1)
稳定
In-place
希尔排序
O(nlogn)
O(1)
不稳定
In-place
归并排序
O(nlogn)
O(n)
稳定
Out-place...
阅读全文
2021-08-02
参考:https://zhuanlan.zhihu.com/p/124356219
时间复杂度:O(nlogn)空间复杂度:O(n)稳定性:稳定
12345678910111213141516171819202122232425262728293031323334353637383940func mergeSort(arr []int) {temp...
阅读全文
2021-08-02
参考链接:https://www.cnblogs.com/chengxiao/p/6129630.html
123456789101112131415161718192021222324252627282930//堆排序func headSort(arr []int) {length := len(arr)for i := length/2 - 1...
阅读全文
2021-07-30
题目:https://leetcode-cn.com/problems/reverse-nodes-in-k-group/
12345678910111213141516171819202122232425262728293031323334353637383940/** * Definition for singly-linked list. * type...
阅读全文
2021-07-28
题目:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/
12345678910111213141516171819202122232425262728func lengthOfLongestSubstring(s string) int {...
阅读全文
2021-07-26
题目: https://leetcode-cn.com/problems/reverse-linked-list/
多指针
12345678910111213141516171819/** * Definition for singly-linked list. * type ListNode struct { * Val int * ...
阅读全文
2021-07-20
快排
哎,比想象中的花时间啊!
代码这东西,还是保持手感。唯手熟尔。
1234567891011121314151617181920212223242526272829func sortArray(nums []int) []int { start := 0 left := 0 right := len(nums) - 1 ...
阅读全文
2021-07-07
说3个事情。
**第一个事情。**我前段时间因为项目暂停的原因,通过一个朋友A 介绍帮他的一个朋友B做了一些她的游戏账号出租的项目功能修改。这个项目是个人的,据说每个月现在有个3W左右的收益。在做的过程中我大概了解下这个项目的业务流程,觉得这个系统我自己也可以做啊。然后开始分析各个功能模块和产品流程,发现整个系统的技术也很简单。
在这个分析过程中呢,我通过朋...
阅读全文
上一页 1 2 3 4 下一页