随笔分类 - data structure & algorithm
摘要:#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; ev
阅读全文
摘要:看到一篇关于最佳线程数相关的文章,内容比较经典,不敢私藏,分享一下! 最佳线程数: 性能压测的情况下,起初随着用户数的增加,QPS会上升,当到了一定的阀值之后,用户数量增加QPS并不会增加,或者增加不明显,同时请求的响应时间却大幅增加。这个阀值我们认为是最佳线程数。 为什么要找最佳线程数 1.过多的
阅读全文
摘要:a. 由于MapReduce的shuffle过程需写磁盘,比较影响性能;而Spark利用RDD技术,计算在内存中进行.b. MapReduce计算框架(API)比较局限, 而Spark则是具备灵活性的并行计算框架.c. 再说说Spark API方面- Scala: Scalable Language...
阅读全文
摘要:HIVEMap Join is nothing but the extended version of Hash Join of SQL Server - just extending Hash Join into Distributed System.SMB(Sort Merge Bucket)J...
阅读全文
摘要:关系型数据库系统以二维表的形式呈现数据,比如下面的员工表RowIdEmpIdLastnameFirstnameSalary00110SmithJoe4000000212JonesMary5000000311JohnsonCathy4400000422JonesBob55000上面的格式仅仅存在于理论...
阅读全文
摘要:Answer:I understand the IEnumerator/IEnumerable methods and properties and also how they are interrelated. But I fail to understand from the foreach loop perspective. Say for example, if I say the following line of code, how does the compiler look at foreach loop and break it down to IEnumerable/IEn
阅读全文
摘要:摘要:这个HashTable用开放定址法解决冲突,用双散列法进行探测。装填因子过高之后使用再散列法扩充,涉及到的算法都不是很复杂,即使不使用数学工具,也可以简单的分析下:-) 。本文以.net fx's HashTable为例,回顾HashTable的基础理论。HashTable是一种能提供快速插入和查询的数据结构,无论其包含有多少Item,查询和插入操作的平均时间总是接近O(1)。HashTable理论上并不关心其所包含的item顺序,任何与顺序有关的操作例如:“find_min, find_max”,都不能有效的支持。Hashing假如我们把一本英汉字典的5000个单词, 从a到z
阅读全文
摘要:00 – 背景知识- B-Tree & B+Treehttp://en.wikipedia.org/wiki/B%2B_treehttp://en.wikipedia.org/wiki/B-tree- 折半查找(Binary Search)http://en.wikipedia.org/wiki/Binary_search_algorithm- 数据库的性能问题 A. 磁盘IO性能非常低,严重的影响数据库系统的性能。 B. 磁盘顺序读写比随机读写的性能高很多。- 数据的基本存储结构 A. 磁盘空间被划分为许多大小相同的块(Block)或者页(Page). B. 一个表的这些数据块以链表
阅读全文
摘要:One is who ever read <Database System Concepts>, another is who does not read it.
阅读全文
摘要:When we are access a website, after finishing a pair of HTTP request/response, the TCP connectionis NOTclosed immediately, but after some time, basically depending on the seeting value of client web browser, like for IE, the default value is 1 minute, you can change the default value, refer to http:
阅读全文
摘要:Context-boundobjectsareaspecialcaseof.NETremoting(inparticular,ofclient-activatedobjects).Inmanyrespects.NETtreatsthemjustlikeremoteobjects,butitdoesoptimizesomeelementsofitsremotingarchitectureforcontext-boundobjects—forexample,asmentionedpreviously,thechannelusedforcross-contextcallsisanoptimizedc
阅读全文
摘要:之前在一本介绍操作系统的书上看到说,由MMU内存管理单元负责把虚拟内存地址转换为物理内存地址。 后来在研究 Page Table的时候有看到介绍这么说,When a process requests access to its memory, it is the responsibility of the operating system to map the virtual address pr...
阅读全文
摘要:A. HashTable, Dictionary<TKey, TValue>, SortedDictionary<TKey, TValue>, SortedList<TKey, TValue>0. HashTable, Dictionary<TKey, TValue>, 基于哈希表。SortedDictionary<TKey, TValue&g...
阅读全文
摘要:17.1 数组与内存变量需要占用内存空间,内存空间有地址。不同数据类型的变量,可能占用不同的内存大小及有不同的内存结构。以前我们所学都称为“简单数据类型”,如:int,char,float,double,bool。像 char,bool,只占用一个字节,所以我们不去管它的的“结构”,其余如int,float,double占用多个字节,但比较简单,适当...
阅读全文
摘要:数据的概念不再是狭义的,数据已由纯粹的数值概念发展到图像、字符、声音等各种符号。例如对C源程序,数据概念不仅是源程序所处理的数据,相对于编译程序来说,C编译程序相对于源程序是一个处理程序,它加工的数据是字符流的源程序( .c),输出的结果是目标程序( .obj),对于链接程序来说,它加工的数据是目标程序( .obj),输出的结果是可执行程序( .exe)。而对于C编译程序,由于它在操作系统控制下接...
阅读全文
摘要:最近学习了数据结构中的哈夫曼树(最优二叉树),说的是:给定个数的叶子,拥有不同的权值,使得根到各叶子的带权路径的和最小。了解到了一些基本应用,比如,数据编码:在某资料中,假设就出现26个字母+9个数字,字母中只有6-10个出现的概率比较高(权值比较大),如何对这些字符不同的编码长度(给以不同的路径),使得总的编码长度最小。即实现较好的压缩算法。联想到,社会决策判断方面,就比如说两会:人大代表,其权...
阅读全文
摘要:publicclassBinaryNode{publicintData;publicBinaryNodeLeft;publicBinaryNodeRight;}publicclassBinaryTree{publicvoidPreOrder(BinaryNodenode){if(node!=null){Console.WriteLine(node.Data);PreOrder(node.Left)...
阅读全文
摘要:树是好的DS——它有非常简单而高效的线性化规则,因此可以利用树设计出许多非常高效的算法。树的实现和使用都很简单,但可以解决大量特殊的复杂问题,因此树是实际编程中最重要和最有用的一种数据结构。树的结构本质上有递归的性质——每一个叶节点可以被一棵子树所替代,反之亦然。实际上,每一种递归的结构都可以被转化为(或等价于)树形结构。
阅读全文
摘要:1. 冒泡排序 void sort(int[] array) { for(int i = 0; i array[j]) swap(ref array[i], ref array[j]); } } } void swap(...
阅读全文
浙公网安备 33010602011771号