
Reading Notes
文章平均质量分 79
littleorange6
这个作者很懒,什么都没留下…
展开
-
算法竞赛入门经典第六章
6.1.1 卡片游戏 C++ STL 队列的相关操作 入队 q.push(x) 出队 q.pop() 访问队首 q.front() 访问队尾 q.back() 判断队列空 q.empty() 队列中的元素个数 q.size() #include #include using namespace std; queue q; int main() {原创 2015-08-17 14:08:05 · 655 阅读 · 0 评论 -
算法竞赛入门经典第五章
例 5.1.3 周期串 fgets(str, MAX, stdin); scanf("%s",str); fgets()函数执行后,str会读到‘\n’符号停下,也就是提取一行,‘\n’也被读进字串,因此strlen(str)会比原本输入的字符串多一个;除了一种很特殊的情况,读入一行时,只一行并不是以’\n‘结束,而是以EOF结束。 scanf()遇到’\n‘,space,tab就会停下,而原创 2015-08-10 19:27:33 · 587 阅读 · 0 评论 -
算法竞赛入门经典第三章
习题3-4 计算器(calculator) #include int main() { int n1,n2; char f; scanf("%d %c%d",&n1,&f,&n2); switch(f) { case '+': printf("%d", n1 + n2);break; case '-': printf("%原创 2015-08-09 11:36:51 · 303 阅读 · 0 评论 -
[Coursera] Princeton算法(Part 1)笔记+作业
欢迎来 https://github.com/JenniferZh/PrincetonAlgorithmsPart1 围观源码 Contents Notes HomeWork Reports Percolation 8puzzle kdtree Notes Java对象内存大小估计 一个有n个元素的stack, 其中每个元素: class overhead:16bytes inner ...原创 2018-11-20 14:28:50 · 2048 阅读 · 0 评论