浙大《数据结构》编程作业
Bazinga!
这个作者很懒,什么都没留下…
展开
-
浙大《数据结构》09-排序3 Insertion or Heap Sort
According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, an原创 2020-05-19 17:29:57 · 175 阅读 · 0 评论 -
浙大《数据结构》08-图9 关键活动
假定一个工程项目由一组子任务构成,子任务之间有的可以并行执行,有的必须在完成了其它一些子任务后才能执行。“任务调度”包括一组子任务、以及每个子任务可以执行所依赖的子任务集。比如完成一个专业的所有课程学习和毕业设计可以看成一个本科生要完成的一项工程,各门课程可以看成是子任务。有些课程可以同时开设,比如英语和C程序设计,它们没有必须先修哪门的约束;有些课程则不可以同时开设,因为它们有先后的依赖关系,比如C程序设计和数据结构两门课,必须先学习前者。但是需要注意的是,对一组子任务,并不是任意的任务调度都是一个可原创 2020-05-19 11:27:59 · 246 阅读 · 0 评论 -
浙大《数据结构》09-排序2 Insert or Merge
According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, an原创 2020-05-19 11:00:02 · 175 阅读 · 0 评论 -
浙大《数据结构》06-图2 Saving James Bond - Easy Version
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原创 2020-05-12 23:33:13 · 337 阅读 · 1 评论 -
浙大《数据结构》06-图3 六度空间 (30分)
“六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所间隔的人不会超过六个,也就是说,最多通过五个人你就能够认识任何一个陌生人。”如图1所示。“六度空间”理论虽然得到广泛的认同,并且正在得到越来越多的应用。但是数十年来,试图验证这个理论始终是许多社会学家努力追求的目标。然而由于历史的原因,这样的研究具有太大的局限性和困难。随着当代人的联络主要依赖于电话、短信、微信以及因特网上即时通信等工具,能够体现社交网络关系的原创 2020-05-12 23:12:19 · 692 阅读 · 0 评论 -
浙大《数据结构》03-树3 Tree Traversals Again
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 keys numbered from 1 t...原创 2020-05-07 23:28:31 · 273 阅读 · 0 评论 -
浙大《数据结构》编程作业 01-复杂度3 二分查找
01-复杂度3 二分查找 (20分)本题要求实现二分查找算法。(下面只列出部分定义)函数接口定义:Position BinarySearch( List L, ElementType X );其中List结构定义如下:typedef int Position;typedef struct LNode *List;struct LNode { ElementType Data...原创 2020-05-03 11:45:00 · 242 阅读 · 0 评论 -
浙大《数据结构》编程作业 线性结构2 一元多项式的乘法与加法运算
题目设计函数分别求两个一元多项式的乘积与和。输入格式输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式输出分2行,分别以指数递降方式输出乘积多项式以及和多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。零多项式应输出0 0。输入样例4 3 4 -5 2 6 1 ...原创 2020-05-02 23:37:13 · 412 阅读 · 0 评论