摘要: Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social n... 阅读全文
posted @ 2015-02-27 15:48 糙哥 阅读(265) 评论(0) 推荐(0) 编辑
摘要: “六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过五个人你就能够认识任何一个陌生人。”如图6.4所示。图6.4 六度空间示意图“六度空间”理论虽然得到广泛的认同,并... 阅读全文
posted @ 2015-02-15 10:14 糙哥 阅读(1841) 评论(0) 推荐(0) 编辑
摘要: This time let us consider the situation in the movie "Live and Let Die" in which James Bond, the world's most famous spy, was captured by a group of d... 阅读全文
posted @ 2015-02-12 20:08 糙哥 阅读(767) 评论(0) 推荐(0) 编辑
摘要: For a given undirected graph with N vertices and E edges, please list all the connected components by both DFS and BFS. Assume that all the vertices a... 阅读全文
posted @ 2015-02-12 19:27 糙哥 阅读(1237) 评论(0) 推荐(0) 编辑
摘要: In 1953, David A. Huffman published his paper "A Method for the Construction of Minimum-Redundancy Codes", and hence printed his name in the history o... 阅读全文
posted @ 2015-02-11 17:02 糙哥 阅读(4279) 评论(3) 推荐(1) 编辑
摘要: We have a network of computers and a list of bi-directional connections. Each of these connections allows a file transfer from one computer to another... 阅读全文
posted @ 2015-02-11 16:06 糙哥 阅读(1595) 评论(0) 推荐(0) 编辑
摘要: An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any... 阅读全文
posted @ 2015-02-11 15:08 糙哥 阅读(2834) 评论(3) 推荐(1) 编辑
摘要: An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the... 阅读全文
posted @ 2015-02-09 14:17 糙哥 阅读(4745) 评论(3) 推荐(0) 编辑
摘要: Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one tes... 阅读全文
posted @ 2015-02-08 20:14 糙哥 阅读(3694) 评论(1) 推荐(0) 编辑
摘要: 二分法求函数根的原理为:如果连续函数f(x)在区间[a, b]的两个端点取值异号,即f(a)f(b) 2 #include 3 #include 4 using namespace std; 5 6 float f( float x); 7 float a3, a2, a1, a0; 8 9... 阅读全文
posted @ 2015-02-08 20:03 糙哥 阅读(1580) 评论(0) 推荐(0) 编辑