![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构mooc
文章平均质量分 60
很菜
这个作者很懒,什么都没留下…
展开
-
7-10 Saving James Bond - Easy Version (25 分)
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 drug dealers. He was sent to a small piece of land at the center of a lake filled with crocodiles. There he原创 2021-02-11 22:20:47 · 107 阅读 · 0 评论 -
7-5 堆中的路径 (25 分)
05-树7 堆中的路径 (25 分) 将一系列给定数字插入一个初始为空的小顶堆H[]。随后对任意给定的下标i,打印从H[i]到根结点的路径。 输入格式: 每组测试第1行包含2个正整数N和M(≤1000),分别是插入元素的个数、以及需要打印的路径条数。下一行给出区间[-10000, 10000]内的N个要被插入一个初始为空的小顶堆的整数。最后一行给出M个下标。 输出格式: 对输入中给出的每个下标i,在一行中输出从H[i]到根结点的路径上的数据。数字间以1个空格分隔,行末不得有多余空格。 输入样例: 5 3 4原创 2021-02-06 13:14:27 · 106 阅读 · 0 评论 -
04-树5 Root of AVL Tree (25 分)
04-树5 Root of AVL Tree (25 分) 虽然借鉴了别人的思路,但是第一次自己写出代码,值得纪念,希望下次可以自己手写出来。 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 time they differ by more than one原创 2021-02-04 18:49:18 · 91 阅读 · 2 评论