- 博客(22)
- 资源 (2)
- 收藏
- 关注
原创 6.824(Lec 2)
Threads and garbage collection work particularly well together, since garbage collection caneliminate programmer effort to decide when the last thread using an object has stopped using it. https://gol...
2018-03-14 21:05:23
380
原创 Go intro
“package declaration”. Every Go program must start with a package declaration. Packages are Go's way of organizing and reusing code. There are two types of Go programs: executables and libraries.impo...
2018-03-14 08:20:48
295
原创 gdb
在gdb版本信息输出之后,输入help得到list of classes of commands,输入help command得到相应command的详细解释。gdb -help简略帮助信息在编译时,我们必须要把调试信息加到可执行文件中。使用编译器( cc/gcc/g++)的 -g 参数可以做到这一点。如:gcc -g hello.c -o hello g++ -g hello.cpp -o he...
2018-03-13 21:18:57
211
原创 6.824(Lec 1)MapReduce
MapReduce论文论文 中文版 http://blog.youkuaiyun.com/zealotcat/article/details/5148091MapReduce,解决数据切割,机器间通信,集群调度,处理错误等。在输入数据的“逻辑”记录上应用Map操作得出一个中间key/value pair集合,然后在所有具有相同key值的value值上应用Reduce操作,从而达到合并中间的数据,得到一个想要...
2018-03-08 09:26:44
309
原创 unordered_map::emplace学习
先不说insert与emplace之间的区别,只说emplace。emplace允许construct element in place without move or copy.使用forwarding和variadic template(可变模板)来forward arguments to the constructor of the key-value pair.templatecl
2015-08-17 16:26:30
9053
原创 leetcode30 Substring with Concatenation of All Word
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without
2015-01-27 10:08:38
455
转载 标准C++中的string类的用法总结
文章内容来自http://www.cnblogs.com/xFreedom/archive/2011/05/16/2048037.html
2014-09-02 10:39:58
331
原创 The C programming language 4.1
4.2对ATOF函数进行扩充,使它可以处理形如123.45e-6的科学表示法,其中浮点数后面可能会跟e或E以及一个指数。#include #include #include #include #define MAX 15double atof_test(char[]);int main(void){ int i = 0; double result; char s[M
2014-08-06 00:29:12
645
原创 K&R The C Programming language 2
2-1打印标准头文件中的响应值,确定signed & unsigned限定的char / short / int / long类型变量的取值范围。#include #include int main(void){ printf("Size of Char %d.\n", CHAR_BIT); printf("Size of Char MAX %d.\n", CHAR_MAX);
2014-07-17 09:00:52
750
原创 数据结构与算法分析10(排序-插入、冒泡、希尔、堆、归并)
#include #include #include #define Heap_LeftChild(i) (2*i+1)void sort_insert(int [],int);void sort_bulb(int [],int);void sort_Shell(int [],int);void sort_Heap(int [],int);//Delete操作进行排序void
2014-05-27 20:19:59
573
原创 数据结构学习笔记8 树 课后习题
4.29参考了答案#include #include typedef struct Node * RanTree;typedef RanTree Position;struct Node{ int Data; RanTree Left; RanTree Right;};RanTree SearchTree(int N);RanTree RandomSearchT
2014-03-03 22:20:50
626
原创 数据结构学习笔记7(树)
PS:第三章作业比较多,需要编程实现的我会逐步做完,也保证一直对第三章知识有印象。先来学习第四章一 基础知识没有儿子的节点是树叶(leaf);有相同父亲的节点师兄弟sibling从节点n_1到n_i+1的路径path定义为节点n_1,n_2,,,,n_k的一个序列,n_i是n_i+1的父亲,路径长length为路径上的边的条数即k-1n_i的深度depth是从根到n_i的唯一路径长
2014-02-20 20:21:16
502
原创 数据结构学习笔记6(队列)
1链队列的初始化,建立,插入,查找,删除转载自http://www.cnblogs.com/newwy/archive/2010/10/10/1847463.html。本程序的队列实现思想:队列是先进先出的。也就是说看做从后面进从前面出。我本以为用链表实现时做一个双向链表,但是如本文所示,可以做两个链表指针分别指向对头和对尾用作插入数据、删除。至于计数什么的就很简单了代码 //
2014-02-19 16:43:58
536
原创 数据结构学习笔记5(栈)
一 栈在学习汇编语言时候曾经简要接触过栈。栈可能是继数组之后在技术安吉科学中最基本的数据结构。基本思想是先进先出,可以看做是一个桶。最先进入的最后出,最后进的最先出。栈可以用链表或者数组实现。数组实现的缺点在于需要提前预知栈的大小,并定义出来;但是,一般在应用程序中,即使有相当多的栈操作,在任意时刻站元素的实际个数也不会太大。链表可以节省潜在的空间,但是链表实现需要空间定义指针,并且消耗时
2014-02-17 17:54:38
868
原创 约瑟夫问题的数学角度分析 C 数组实现 循环链表实现 递归实现时间复杂度O(logN)
MARK这一章准备做约瑟夫问题,但是想在没心情,先Mark
2014-02-17 15:38:14
2122
转载 排序学习记录
冒泡冒泡排序的基础版和进阶版(主要参考http://blog.youkuaiyun.com/morewindows/article/details/6657829,也有自己玩的东西)进一步的优化。如果有100个数的数组,仅前面10个无序,后面90个都已排好序且都大于前面10个数字,那么在第一趟遍历后,最后发生交换的位置必定小于10,且这个位置之后的数据必定已经有序了,记录下这位置,第二次只要从数组头部遍历到这
2013-12-25 16:44:22
600
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人