数据结构
数据结构的学习
AlbertChenTao
这个作者很懒,什么都没留下…
展开
-
02-线性结构3 Reversing Linked List (25分)
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→...原创 2020-04-14 00:42:51 · 203 阅读 · 0 评论 -
02-线性结构2 一元多项式的乘法与加法运算 (20分) 浙大PTA
设计函数分别求两个一元多项式的乘积与和。输入格式:输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:输出分2行,分别以指数递降方式输出乘积多项式以及和多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。零多项式应输出0 0。输入样例:4 3 4 -5 2...原创 2020-04-13 17:03:27 · 354 阅读 · 0 评论 -
c语言实现顺序表的增删改查
#include <iostream>using namespace std;#define MAXSIZE 100#define Elemtype Booktypedef struct{ char no[20]; char name[50]; float price;} Book;typedef struct{ //顺序表 ...原创 2020-02-24 23:40:32 · 734 阅读 · 0 评论 -
数据结构 单链表
typedef struct LNode{ //单链表的存储结构 Elemtype data; struct LNode *next;} LNode,*LinkList;//LinkList为指向结构体LNode的指针类型为了提高程序的可读性,在此对同一结构体指针类型起了两个名称,LinkList 与 LNode*, 两者本质上是等价的。通常习惯上用Lin...原创 2020-02-25 14:43:31 · 540 阅读 · 0 评论 -
浙大PTA数据结构 01-复杂度2 Maximum Subsequence Sum (25分)
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 subsequen...原创 2020-04-03 21:29:55 · 260 阅读 · 0 评论