摘要: “六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过五个人你就能够认识任何一个陌生人。”如图1所示。 图1 六度空间示意图 “六度空间”理论虽然得到广泛的认同,并且正 阅读全文
posted @ 2018-10-11 18:48 interim 阅读(245) 评论(0) 推荐(0)
摘要: 因为自己偶尔会用到,修改注册表什么的, 所以从网上找了代码,便于以后修改. 转存过来. 阅读全文
posted @ 2018-10-09 09:48 interim 阅读(1313) 评论(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 @ 2018-10-05 22:34 interim 阅读(238) 评论(0) 推荐(0)
摘要: 将一系列给定数字插入一个初始为空的小顶堆H[]。随后对任意给定的下标i,打印从H[i]到根结点的路径。 输入格式: 每组测试第1行包含2个正整数N和M(≤1000),分别是插入元素的个数、以及需要打印的路径条数。下一行给出区间[-10000, 10000]内的N个要被插入一个初始为空的小顶堆的整数。 阅读全文
posted @ 2018-10-05 01:47 interim 阅读(164) 评论(0) 推荐(0)
摘要: 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 @ 2018-10-05 01:43 interim 阅读(132) 评论(0) 推荐(0)
摘要: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
posted @ 2018-10-01 14:56 interim 阅读(159) 评论(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 阅读全文
posted @ 2018-09-30 11:56 interim 阅读(236) 评论(0) 推荐(0)
摘要: 给定一个插入序列就可以唯一确定一棵二叉搜索树。然而,一棵给定的二叉搜索树却可以由多种不同的插入序列得到。例如分别按照序列{2, 1, 3}和{2, 3, 1}插入初始为空的二叉搜索树,都得到一样的结果。于是对于输入的各种插入序列,你需要判断它们是否能生成一样的二叉搜索树。 输入格式: 输入包含若干组 阅读全文
posted @ 2018-09-29 13:17 interim 阅读(110) 评论(0) 推荐(0)
摘要: 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 @ 2018-09-29 13:16 interim 阅读(132) 评论(0) 推荐(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 t 阅读全文
posted @ 2018-09-29 13:15 interim 阅读(144) 评论(0) 推荐(0)