![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法与数据结构
小羊黛马
这个作者很懒,什么都没留下…
展开
-
数据结构 | PTA 函数题 01-复杂度3 二分查找
本题要求实现二分查找算法。函数接口定义:Position BinarySearch( List L, ElementType X );其中List结构定义如下:typedef int Position;typedef struct LNode *List;struct LNode { ElementType Data[MAXSIZE]; Position Last; ...原创 2019-05-11 22:34:34 · 191 阅读 · 0 评论 -
数据结构 | PTA 函数题 02-线性结构1 两个有序链表序列的合并
题要求实现一个函数,将两个链表表示的递增整数序列合并为一个非递减的整数序列。函数接口定义:List Merge( List L1, List L2 );其中List结构定义如下:typedef struct Node *PtrToNode;struct Node { ElementType Data; /* 存储结点数据 */ PtrToNode Next; /* ...原创 2019-05-11 22:42:38 · 390 阅读 · 0 评论 -
数据结构 | PTA 函数题 04-树7 二叉搜索树的操作集
本题要求实现给定二叉搜索树的5种常用操作。函数接口定义:BinTree Insert( BinTree BST, ElementType X );BinTree Delete( BinTree BST, ElementType X );Position Find( BinTree BST, ElementType X );Position FindMin( BinTree BST );...原创 2019-05-12 13:16:14 · 343 阅读 · 0 评论 -
数据结构 | PTA 编程题 01-复杂度1 最大子列和问题
给定K个整数组成的序列{ N1, N2, …, NK },“连续子列”被定义为{ Ni, Ni+1, …, Nj },其中 1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, -4, 13, -5, -2 },其连续子列{ 11, -4, 13 }有最大的和20。现要求你编写程序,计算给定整数序列的最大子列和。...原创 2019-05-12 13:39:22 · 188 阅读 · 0 评论 -
数据结构 | PTA 编程题 01-复杂度2 Maximum Subsequence Sum
Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence w...原创 2019-05-12 14:41:55 · 372 阅读 · 0 评论 -
PAT | A 1001 Format
Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input fil...原创 2019-08-28 12:27:48 · 76 阅读 · 0 评论 -
PAT | A 1002 for Polynomials
This time, you are supposed to find A+B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the informati...原创 2019-08-28 13:19:40 · 73 阅读 · 0 评论