- 博客(5)
- 收藏
- 关注
原创 关于计数排序的一点思考
今天看《算法导论》时,看到计数排序,实现简单的同时,时间复杂度也较小,当待排序元素在[0, k]的区间以及k=O(n)时,整个算法的时间复杂度仅为O(n),低于所有比较排序算法。于是我不禁感到奇怪:既然计数排序有着这样的优点,为什么并不见很多地方用到呢?void countingSort(int *a, int *b, int n) {//a-待排序数组,b-输出数组 int max = INT...
2018-04-04 15:16:49
448
原创 牛客网 leetcode 在线编程训练 gas-station
题目:链接:https://www.nowcoder.com/questionTerminal/3b1abd8ba2e54452b6e18b31780b3635来源:牛客网There are N gas stations along a circular route, where the amount of gas at station i isgas[i]. You have a car ...
2018-03-28 15:28:43
501
原创 牛客网 leetcode在线编程训练 evaluate-reverse-polish-notation
题目:链接:https://www.nowcoder.com/questionTerminal/22f9d7dd89374b6c8289e44237c70447?orderByHotValue=1&mutiTagIds=581&page=1&onlyReference=false来源:牛客网Evaluate the value of an arithmetic expres...
2018-03-25 12:17:06
363
原创 牛客网 leetcode在线编程训练 word-break
这段时间开始系统地看算法导论这本书了,再加上以前也上过算法课程,所以开始在牛客网或者leetcode上做一些算法题,我的解决方案可能不够好,但都是最后ac的代码,如果有分析错误的地方还请大家告知,欢迎大家讨论~题目:链接:https://www.nowcoder.com/questionTerminal/5f3b7bf611764c8ba7868f3ed40d6b2c?orderByHotValu...
2018-03-23 15:43:22
638
原创 macOS下安装配置gradle
macOS下很多操作不像windows那么直观,一些软件的配置也与windows有区别,因此记录一下。本文建立在已安装java jre和jdk的情况下。1、登录gradle官网下载https://gradle.org/install/2、将下载后的gradle包放在想要安装的地方并解压,我是放在/users/xjy/下的3、配置环境变量打开终端,键入vim ~/.bash_
2017-08-03 10:13:41
621
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人