上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 89 下一页
摘要: 哈利·波特要考试了,他需要你的帮助。这门课学的是用魔咒将一种动物变成另一种动物的本事。例如将猫变成老鼠的魔咒是haha,将老鼠变成鱼的魔咒是hehe等等。反方向变化的魔咒就是简单地将原来的魔咒倒过来念,例如ahah可以将老鼠变成猫。另外,如果想把猫变成鱼,可以通过念一个直接魔咒lalala,也可以将 阅读全文
posted @ 2019-05-06 18:20 王清河 阅读(215) 评论(0) 推荐(0) 编辑
摘要: “六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过五个人你就能够认识任何一个陌生人。”如图1所示。 “六度空间”理论虽然得到广泛的认同,并且正在得到越来越多的应用。 阅读全文
posted @ 2019-05-05 19:32 王清河 阅读(500) 评论(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 @ 2019-04-29 19:07 王清河 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 给定一个有N个顶点和E条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。 输入格式: 输入第1行给出2个整数N(0)和E,分别是图的顶点数和边数。随后E行,每行给出一条边的两个端点。每行中的数字 阅读全文
posted @ 2019-04-24 18:24 王清河 阅读(389) 评论(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 @ 2019-04-24 16:52 王清河 阅读(296) 评论(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 @ 2019-04-20 13:10 王清河 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 将一系列给定数字插入一个初始为空的小顶堆H[]。随后对任意给定的下标i,打印从H[i]到根结点的路径。 输入格式: 每组测试第1行包含2个正整数N和M(≤),分别是插入元素的个数、以及需要打印的路径条数。下一行给出区间[-10000, 10000]内的N个要被插入一个初始为空的小顶堆的整数。最后一行 阅读全文
posted @ 2019-04-18 10:57 王清河 阅读(328) 评论(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 @ 2019-04-15 08:59 王清河 阅读(1120) 评论(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 @ 2019-04-12 18:21 王清河 阅读(191) 评论(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 @ 2019-04-08 12:17 王清河 阅读(270) 评论(0) 推荐(0) 编辑
上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 89 下一页