
中国大学MOOC-陈越、何钦铭-数据结构
文章平均质量分 57
MoonLatte
少年啊
展开
-
中国大学MOOC-陈越、何钦铭-数据结构(第二次课2-2)
02-线性结构3 Reversing Linked List 问题描述: Given a constantKand a singly linked listL, you are supposed to reverse the links of everyKelements onL. For example, givenLbeing 1→2→3→4→5→6, ifK=3, then you must output 3→2→1→6→5→4; ifK=4, you must output...原创 2021-11-12 16:19:22 · 772 阅读 · 0 评论 -
中国大学MOOC-陈越、何钦铭-数据结构(第二次课2-1)
02-线性结构1 两个有序链表序列的合并 问题描述: 本题要求实现一个函数,将两个链表表示的递增整数序列合并为一个非递减的整数序列。 函数接口定义: List Merge( List L1, List L2 ); 其中List结构定义如下: typedef struct Node *PtrToNode; struct Node { ElementType Data; /* 存储结点数据 */ PtrToNode Next; /* 指向下一个结点的指针 */ }; type原创 2021-10-19 17:51:52 · 185 阅读 · 0 评论 -
中国大学MOOC-陈越、何钦铭-数据结构(第一次课1-3)
01-复杂度3 二分查找 问题描述: 本题要求实现二分查找算法。 函数接口定义: Position BinarySearch( List L, ElementType X ); 其中List结构定义如下: typedef int Position; typedef struct LNode *List; struct LNode { ElementType Data[MAXSIZE]; Position Last; /* 保存线性表中最后一个元素的位置 */ }; L是用户原创 2021-10-19 17:46:44 · 229 阅读 · 0 评论 -
中国大学MOOC-陈越、何钦铭-数据结构(第一次课1-2)
01-复杂度2 Maximum Subsequence Sum 问题描述: Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest s...原创 2021-10-17 23:57:19 · 127 阅读 · 0 评论 -
中国大学MOOC-陈越、何钦铭-数据结构(第一次课1-1)
01-复杂度1 最大子列和问题 题目描述: 给定K个整数组成的序列{N1,N2, ...,NK},“连续子列”被定义为{Ni,Ni+1, ...,Nj},其中1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, -4, 13, -5, -2 },其连续子列{ 11, -4, 13 }有最大的和20。现要求你编写程序,计算给定整数序列的最大子列和。 本题旨在测试各种不同的算法在各种数据情况下的表现。各组测试数据特点如下: 数...原创 2021-10-17 23:51:50 · 189 阅读 · 0 评论