2017年11月12日

算法复习_线性时间求解Majority Vote Algorithm问题

摘要: 题目来源于Leecode上的Majority Element问题 Majority Element:在一个序列中出现了至少n/2的下界次 使用排序算法取中位数则需要Nlogn http://www.cs.utexas.edu/~moore/best-ideas/mjrty/ 介绍了一种线性时间内的算 阅读全文

posted @ 2017-11-12 20:41 mdumpling 阅读(222) 评论(0) 推荐(0)

<string> 与<string.h>、<cstring>的区别

摘要: <string.h> <string.h>是C版本的头文件,包含比如strcpy、strcat之类的字符串处理函数。 <cstring> 在C++标准化(1998年)过程中,为了兼容以前,标准化组织将所有这些文件都进行了新的定义,加入到了标准库中,加入后的文件名就新增了一个"c"前缀并且去掉了.h的 阅读全文

posted @ 2017-11-12 18:39 mdumpling 阅读(654) 评论(0) 推荐(0)

导航