![](https://img-blog.csdnimg.cn/20200311105704316.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
PTA:MOOC_数据结构_习题集
记录习题中的各种问题,供反复考究。
西阿西瓜瓜小花
暂无
展开
-
01-复杂度3-二分查找-函数题
01-复杂度3-二分查找-函数题解题代码测试结果问题整理解题代码Position BinarySearch( List L, ElementType X ){ Position ret=NotFound; Position left=1,right=L->Last; Position loc; while(left<=right){ ...原创 2020-04-21 15:38:08 · 196 阅读 · 0 评论 -
中国大学MOOC-陈越、何钦铭-数据结构-2020春期末考试-还原二叉树-编程题
中国大学MOOC-陈越、何钦铭-数据结构-2020春期末考试-还原二叉树-编程题解题代码测试结果问题整理解题代码#include<iostream>#include<stdlib.h>#include<string>using namespace std;typedef struct TNode *Tree;struct TNode { char key; Tree left, right;};char Pre[51], Mid[51];void原创 2020-05-22 11:14:35 · 1088 阅读 · 0 评论 -
11-散列2-Hashing-编程题
11-散列2-Hashing-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<iostream>#include<map>#include<cmath>using namespace std;map<int, int> m;void printk(void) { static int flag = 0; if (flag) cout << " "; else flag++;原创 2020-05-20 16:46:04 · 148 阅读 · 0 评论 -
11-散列3-QQ帐户的申请与登陆-编程题
11-散列3-QQ帐户的申请与登陆-编程题解题代码测试结果--scanf测试结果--cin问题整理解题代码#include<iostream>#include<map>#include<stdio.h>#include<string>using namespace std;map<string, string> m;int main(){ int N; char judge; cin >> N; for (in原创 2020-05-18 18:10:39 · 233 阅读 · 0 评论 -
11-散列1-电话聊天狂人-编程题
11-散列1-电话聊天狂人-编程题解题代码测试结果问题整理解题代码#include<iostream>#include<map>#include<string>using namespace std;map<string, int> m;int main(){ string a, b; int N; cin >> N; for (int i = 0; i < N; i++) { cin >> a >原创 2020-05-18 16:28:28 · 174 阅读 · 0 评论 -
08-图7-公路村村通-编程题
08-图7-公路村村通-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#define MAXN 1000#define ERROR -1#define Infinite 65534int dist[MAXN];int N, M;int G[MAXN][MAXN];void Inicialization(void);int CountTotally(void);int FindTheWay(void);int main(){ scanf("%d原创 2020-05-10 21:45:36 · 287 阅读 · 0 评论 -
07-图6-旅游规划-编程题
07-图6-旅游规划-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#define MAXN 500#define Infinite 65534#define error -1typedef struct Data Weight;struct Data { int dist; int cost;};typedef struct GNode *PtrToGNode;struct GNode { i原创 2020-05-08 20:25:23 · 343 阅读 · 0 评论 -
05-树9-Huffman Codes-编程题
05-树9-Huffman Codes-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#include<string.h>#define MAXN 63#define MAXM 1000#define MAXL 1000typedef enum { false, true } bool...原创 2020-05-05 19:32:21 · 178 阅读 · 0 评论 -
07-图4-哈利·波特的考试-编程题
07-图4-哈利·波特的考试-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#define MAXN 100#define Infinity 20000int Edge[MAXN][MAXN];int N;void Judge(int i, int *flag, int *max, int *index);void Initialization...原创 2020-05-04 22:22:14 · 298 阅读 · 0 评论 -
07-图5-Saving James Bond - Hard Version-编程题
07-图5-Saving James Bond - Hard Version-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#include<math.h>#define MAXN 100#define DIA 15#define SIDE 100typedef enum { fals...原创 2020-05-01 20:35:09 · 213 阅读 · 0 评论 -
06-图3-六度空间-编程题
06-图3-六度空间-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#define MAXN 1000#define MAXE (33*MAXN)int A[MAXN+1][MAXN+1], B[MAXN+1], Q[MAXN+1];int N, front = -1, rear = -1;typedef enum { false, true }...原创 2020-04-29 10:59:24 · 489 阅读 · 0 评论 -
06-图1-列出连通集-编程题
06-图1-列出连通集-编程题解题代码测试结果问题整理解题代码Position BinarySearch( List L, ElementType X ){ Position ret=NotFound; Position left=1,right=L->Last; Position loc; while(left<=right){ ...原创 2020-04-26 16:58:25 · 164 阅读 · 0 评论 -
06-图2-Saving James Bond - Easy Version-编程题
06-图2-Saving James Bond - Easy Version-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#include<math.h>//定义初始条件#define diameter 15.0#define side 100.0//定义岸边终点#define...原创 2020-04-25 19:14:42 · 288 阅读 · 3 评论 -
03-树3-Tree Traversals Again-编程题
03-树3-Tree Traversals Again-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#include<string.h>#define MAXN 30int cnt = 1;typedef struct stack* pst;struct stack { int* ...原创 2020-04-22 20:43:58 · 146 阅读 · 0 评论 -
05-树8-File Transfer-编程题
05-树8-File Transfer-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#define MAXN 10000typedef int set[MAXN];void Initialization(set S, int N);void Input_connection(set S);void Check_connection(set S)...原创 2020-04-22 13:12:35 · 291 阅读 · 0 评论 -
04-树6-Complete Binary Search Tree-编程题
04-树6-Complete Binary Search Tree-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#include<math.h>#define MAXN 1000int A[MAXN], B[MAXN + 1];int Cmp(const void* a, const ...原创 2020-04-21 15:35:30 · 116 阅读 · 0 评论 -
05-树7-堆中的路径-编程题
05-树7-堆中的路径-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>typedef struct heap* ph;struct heap { int* data; int rear; int capacity;};ph CreatHeap(int N);void InsertMin(ph...原创 2020-04-19 16:29:15 · 114 阅读 · 0 评论 -
04-树5-Root of AVL Tree-编程题
04-树5-Root of AVL Tree-编程题本题思路来源解题代码测试结果问题整理本题思路来源04-树5 Root of AVL Tree (25 分)【每日一题】解题代码#include<stdio.h>#include<stdlib.h>typedef struct TNode* AVLTree;struct TNode { int data; ...原创 2020-04-08 21:15:03 · 108 阅读 · 0 评论 -
04-树4-是否同一棵二叉搜索树-编程题
04-树4-是否同一棵二叉搜索树-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>typedef struct TNode* BinTree;struct TNode { int data; BinTree Left, Right; int flag;};int Judge(BinTree BS...原创 2020-04-08 18:12:02 · 71 阅读 · 0 评论 -
04-树7-二叉搜索树的操作集-函数题
04-树7-二叉搜索树的操作集-函数题解题代码测试结果问题整理解题代码BinTree Insert(BinTree BST, ElementType X) { if (!BST) { BST = (BinTree)malloc(sizeof(struct TNode)); BST->Data = X; BST->Left = BST->Right = NULL;...原创 2020-04-08 16:24:14 · 112 阅读 · 0 评论 -
03-树2-List Leaves-编程题
03-树2-List Leaves-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>typedef struct node lea;struct node { int left; int right;};typedef struct queue* que;que Newque(void);vo...原创 2020-04-02 14:32:15 · 114 阅读 · 0 评论 -
03-树1-树的同构-编程题
03-树1-树的同构-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#define MaxSize 10typedef struct Node stynode;struct Node { char data; int left; int right;}node1[MaxSize], node2...原创 2020-04-01 21:59:52 · 169 阅读 · 0 评论 -
02-线性结构3-Reversing Linked List-编程题
01-复杂度3-二分查找-函数题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>typedef struct Array array;struct Array { int expon; int next;};int main(){ array a[100000]; int i, j, head, ...原创 2020-03-23 16:51:37 · 138 阅读 · 0 评论 -
02-线性结构4-Pop Sequence-编程题
02-线性结构4-Pop Sequence-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>int main(){ int M, N, num, i, j, l, k, isFirst = 1, *pstack, last; scanf("%d %d %d", &M, &N, &...原创 2020-03-19 10:55:00 · 144 阅读 · 0 评论 -
02-线性结构1-两个有序链表序列的合并-函数题
02-线性结构1-两个有序链表序列的合并-函数题解题代码测试结果问题整理解题代码void Attach(ElementType Data,List *rear);void Free(List L);List Merge( List L1, List L2 ){ List head,rear,front,LT1=L1,LT2=L2; head=(List)malloc(sizeof(...原创 2020-03-16 11:50:54 · 92 阅读 · 0 评论 -
01-复杂度2-Maximum Subsequence Sum-编程题
01-复杂度3-二分查找-函数题解题代码测试结果问题整理解题代码测试结果问题整理原创 2020-03-31 09:15:01 · 130 阅读 · 0 评论 -
02-线性结构2-一元多项式的乘法与加法运算-编程题
01-复杂度3-二分查找-函数题解题代码测试结果问题整理解题代码Position BinarySearch( List L, ElementType X ){ Position ret=NotFound; Position left=1,right=L->Last; Position loc; while(left<=right){ ...原创 2020-03-11 11:46:13 · 157 阅读 · 0 评论