# algorithm **Repository Path**: suihw/algorithm ## Basic Information - **Project Name**: algorithm - **Description**: 复习算法 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2019-05-14 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # algorithm ## 介绍 复习算法 ## 排序算法小结 | 排序算法 | 平均时间复杂度 | 最差时间复杂度 | 空间复杂度 | 是否稳定排序 | | ---------- | -------------- | -------------- | ---------- | ------------ | | 冒泡排序 | O($n^2$) | O($n^2$) | O(1) | 稳定 | | 鸡尾酒排序 | O($n^2 $) | O($n^2 $) | O(1) | 稳定 | | 快速排序 | O(nlogn) | O($n^2$) | O(logn) | 不稳定 | | 堆排序 | O(nlogn) | O(nlogn) | O(1) | 不稳定 | | 计数排序 | O(n + m) | O(n +m) | O(m) | 稳定 | | 桶排序 | O(n) | O(nlogn) | O(n) | 稳定 | [判断链表是否闭环,环长,入环口](https://gitee.com/suihw/algorithm/blob/master/src/ListIsCycle.java) [实现一个栈,该栈有出栈、进栈、取最小元素3个方法。要保证三个方法的时间复杂度都是O(1)](https://gitee.com/suihw/algorithm/blob/master/src/MinStack.java) [求两个整数的最大公约数,要优化算法性能](https://gitee.com/suihw/algorithm/blob/master/src/GetGreatestCommonDivisor.java) [判断一个数是否为2的整数次幂](https://gitee.com/suihw/algorithm/blob/master/src/IsPowerOf2.java) [无序数组的最大相邻差](https://gitee.com/suihw/algorithm/blob/master/src/GetMaxSortedDistance.java) [用栈实现队列](https://gitee.com/suihw/algorithm/blob/master/src/StackQueue.java) [寻找一个正整数全排列的下一个数](https://gitee.com/suihw/algorithm/blob/master/src/FindNextNumber.java) [贪心算法求删除k个数,获取到最小值](https://gitee.com/suihw/algorithm/blob/master/src/RemoveKNumber.java) [实现大整数相加](https://gitee.com/suihw/algorithm/blob/master/src/BigNumberSum.java) [动态规划求解金矿问题](https://gitee.com/suihw/algorithm/blob/master/src/GetBestGoldMining.java) [寻找出现次数为奇数的两个数](https://gitee.com/suihw/algorithm/blob/master/src/FindLostNum.java) [A星寻路算法](https://gitee.com/suihw/algorithm/blob/master/src/AstarSearch.java)