
PTA-Data Structures and Algori
itorly
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT 1002 A+B for Polynomials (25分)
This time, you are supposed to findA+BwhereAandBare two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:KN1aN1N2aN2...原创 2020-12-11 10:27:45 · 120 阅读 · 0 评论 -
PAT(Advanced Level) 1001 A+B Format (20分)
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 file contains one test case. Each case contains a pair of i原创 2020-12-09 21:14:40 · 170 阅读 · 0 评论 -
6-10 Strongly Connected Components(30 分)
为了便于测试也写了ReadG()自己测试没问题,但目前仍无法通过测试样例怀疑是结构体指针的分配与题目用意不符,另外孤立点的输入格式不明Tarjan算法参考修改自:http://blog.youkuaiyun.com/qq_34374664/article/details/77488976#//ReadG()可实现://1.顶点序号任意(但需唯一)//2.顶点输入顺序任意//Re原创 2018-01-15 14:00:01 · 5362 阅读 · 0 评论 -
6-11 Shortest Path [1](25 分)
Write a program to find the unweighted shortest distances from any vertex to a given source vertex in a digraph.Format of functions:void ShortestDist( LGraph Graph, int dist[], Vertex S );where原创 2018-01-16 14:53:26 · 1406 阅读 · 0 评论 -
7-20 Binary Search Tree(25 分)
https://pintia.cn/problem-sets/16/problems/682A binary search tree is uniquely determined by a given ordered insertions of a sequence of positive integers. On the other hand, a given binary search tr...原创 2018-02-09 22:29:57 · 3155 阅读 · 0 评论 -
6-13 Topological Sort(25 分)
Write a program to find the topological order in a digraph.Format of functions:bool TopSort( LGraph Graph, Vertex TopOrder[] );where LGraph is defined as the following:typedef struct AdjVNode *PtrToA...原创 2018-02-15 09:04:21 · 711 阅读 · 0 评论