数据结构
crescentgear
这个作者很懒,什么都没留下…
展开
-
归并排序(非递归)(C语言)
判题网站:PTA得分:13/25#include "stdio.h"#include "stdlib.h"#pragma warning(disable:4996)void Swap(long A[], long i, long j);void Merge(long A[], long temp[], int L, int R, int RightEnd);void MSort(long A[], long temp[], int L, int R);void MergeSort(l原创 2021-10-05 14:46:45 · 269 阅读 · 0 评论 -
Pop Sequence 10/25 sample乱序,一般的Y&N不得分
记得清空作为判断依据的栈,以及考虑会把0压入栈的情况。改前:#pragma warning(disable:4996)#include <stdio.h>#include <stdlib.h>typedef struct Node * List;struct Node //链表{ int number; List next;};int pop(List S);void push(int number , List S);int IsEm原创 2021-07-28 19:27:57 · 115 阅读 · 0 评论 -
栈和队列的简易区别图解之我见
栈的正常书写情况:#pragma warning(disable:4996)#include <stdio.h>#include <stdlib.h>typedef struct Node * List;struct Node{ int number; List next;};List Create(int n);int main(){...原创 2020-04-18 21:58:20 · 330 阅读 · 0 评论 -
02-线性结构2 一元多项式的乘法与加法运算
#pragma warning(disable:4996)#include <stdio.h>#include <stdlib.h>typedef struct Node *List;struct Node{ int coef;//系数 int expon;//指数 List next;};List CreateList(int n);List...原创 2020-03-31 17:56:33 · 164 阅读 · 0 评论 -
01-复杂度2 Maximum Subsequence Sum
链表做法:#pragma warning(disable:4996)#include <stdio.h>#include <stdlib.h>typedef struct Node *List;struct Node{ int number; List next;};List Create(int number);int main(){...原创 2020-03-30 23:12:48 · 124 阅读 · 0 评论 -
01-复杂度1 最大子列和问题
链表写法:#pragma warning(disable:4996)#include <stdio.h>#include <stdlib.h>typedef struct Node *List;struct Node{ int number; List next;};List Create(int number);int mai...原创 2020-03-30 22:18:30 · 99 阅读 · 0 评论 -
01-复杂度3 二分查找
函数接口定义:Position BinarySearch( List L, ElementType X );其中List结构定义如下:typedef int Position;typedef struct LNode *List;struct LNode { ElementType Data[MAXSIZE]; Position Last; /* 保存线性表中...原创 2020-03-17 16:13:10 · 272 阅读 · 0 评论