![](https://img-blog.csdnimg.cn/20200311110321563.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
PTA:English_数据结构与算法_习题集
记录习题中的各种问题,供反复考究。
西阿西瓜瓜小花
暂无
展开
-
7-25-Harry Potter's Exam-编程题
7-25-Harry Potter's Exam-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#define MAXN 100#define Infinite 65534typedef int Weight;typedef struct GNode *PtrToGNode;struct GNod...原创 2020-05-07 16:32:15 · 220 阅读 · 0 评论 -
7-11-Saving James Bond - Hard Version-编程题
7-11-Saving James Bond - Hard Version-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#include<math.h>#define MAXN 100#define SIDE 100#define DIA 15typedef enum { false...原创 2020-04-29 19:42:26 · 215 阅读 · 0 评论 -
7-10-Saving James Bond - Easy Version-编程题
7-10-Saving James Bond - Easy Version-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<math.h>#define MAXN 100#define DIA 15#define SIDE 100typedef enum { false, true } bool;typedef st...原创 2020-04-28 12:10:34 · 181 阅读 · 0 评论 -
7-8-File Transfer-编程题
7-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 19:49:52 · 186 阅读 · 0 评论 -
7-7-Complete Binary Search Tree-编程题
7-7-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 void...原创 2020-04-20 18:05:58 · 299 阅读 · 0 评论 -
7-6-Root of AVL Tree-编程题
7-6-Root of AVL Tree-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>typedef struct tnode* ptn;struct tnode { int data; ptn left, right; int height;};ptn CreatTree(int K);...原创 2020-04-17 20:20:25 · 143 阅读 · 0 评论 -
7-5-Tree Traversals Again-编程题
7-5-Tree Traversals Again-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#include<string.h>int Flag = 1;typedef struct stack* pst;struct stack { int* data; int* flag;...原创 2020-04-17 18:43:32 · 117 阅读 · 0 评论 -
7-4-List Leaves-编程题
7-4-List Leaves-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>typedef struct STNode* pST;struct STNode { int left; int right;};typedef struct queue* pqu;struct queue { s...原创 2020-04-13 18:55:14 · 226 阅读 · 0 评论 -
6-7-Isomorphic-函数题
6-7-Isomorphic-函数题解题代码测试结果问题整理解题代码int Isomorphic(Tree T1, Tree T2) { if (!T1 && !T2) return 1; if (!T1&&T2 || T1 && !T2) return 0; if (T1->Element != T2->Element) re...原创 2020-04-13 17:53:06 · 372 阅读 · 0 评论 -
6-6-Level-order Traversal-函数题
6-6-Level-order Traversal-函数题解题代码测试结果问题整理解题代码void Level_order(Tree T, void(*visit)(Tree ThisNode)) { Tree* queue = (Tree)malloc(10 * sizeof(struct TreeNode)); int front = -1, rear = -1; queue[++r...原创 2020-04-13 17:36:08 · 340 阅读 · 0 评论 -
7-3-Pop Sequence-编程题
7-3-Pop Sequence-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>int main(){ int M, N, K, i, j; scanf("%d %d %d", &M, &N, &K); for (i = 0; i < K; i++) { int ...原创 2020-03-31 10:49:40 · 199 阅读 · 0 评论 -
6-1-Deque-函数题
6-1-Deque-函数题解题代码测试结果问题整理解题代码Deque CreateDeque() { PtrToNode node = (PtrToNode)malloc(sizeof(struct Node)); node->Next = NULL; node->Last = NULL; Deque A = (Deque)malloc(sizeof(struct Dequ...原创 2020-03-31 09:28:48 · 329 阅读 · 0 评论 -
7-2-Reversing Linked List-编程题
7-2-Reversing Linked List-编程题解题代码测试结果问题整理解题代码#include<stdio.h>#include<stdlib.h>#define MaxSize 1000000typedef struct Node node;struct Node { int data; int next;}a[MaxSize];int m...原创 2020-03-29 22:25:54 · 202 阅读 · 0 评论 -
6-2-Two Stacks In One Array-函数题
6-2-Two Stacks In One Array-函数题解题代码测试结果问题整理解题代码Stack CreateStack(int MaxElements) { Stack new = (Stack)malloc(sizeof(struct StackRecord)); new->Capacity = MaxElements; new->Top1 = -1; new-...原创 2020-03-28 11:53:37 · 291 阅读 · 0 评论 -
6-3-Add Two Polynomials-函数题
6-3-Add Two Polynomials-函数题解题代码测试结果问题整理解题代码Polynomial Add(Polynomial a, Polynomial b) { Polynomial add = (Polynomial)malloc(sizeof(struct Node)); Polynomial ret = add; add->Next = NULL; Polyn...原创 2020-03-28 11:20:44 · 633 阅读 · 0 评论 -
6-4-Reverse Linked List-函数题
6-4-Reverse Linked List-函数题解题代码测试结果问题整理解题代码List Reverse(List L){ List t = NULL, s = L->Next, temp, p = L; while (s) { temp = s->Next; s->Next = t; t = s; s = temp; } p->Next...原创 2020-03-28 11:00:50 · 479 阅读 · 0 评论 -
7-1- Maximum Subsequence Sum-编程题
7-1-最大子列和问题-编程题解题代码测试结果问题整理解题代码#include<stdio.h>int main(){ int n; scanf("%d",&n); int a[n]; int i; for(i=0;i<n;i++){ scanf("%d",&a[i]); } int...原创 2020-03-11 12:00:20 · 240 阅读 · 0 评论