- 博客(21)
- 问答 (1)
- 收藏
- 关注
原创 【Python】matplotlib基本绘图总结
import matplotlib.pyplot as plt1.plt.plot() #绘图函数参数:color: 线条颜色(例如color='b'设置为蓝色, ‘g'、'r'、‘y'、'b'、'w'分别为绿红黄黑白)label: 线条标签,若要显示需要加plt.legend()linestyle: 线条风格(’-‘、’--‘、’:‘、'-.' 分别为实线、破折线、...
2019-07-04 12:45:29
615
原创 1003. Emergency (25)
1003. Emergency (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAs an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered...
2018-03-17 17:03:28
244
原创 6-17 Shortest Path [4](25 分)
6-17 Shortest Path [4](25 分)Write a program to find the weighted shortest distances from any vertex to a given source vertex in a digraph. If there is more than one minimum path from v to w, a path wi...
2018-02-25 12:42:13
1057
原创 6-16 Shortest Path [3](25 分)
6-16 Shortest Path [3](25 分)Write a program to not only find the weighted shortest distances, but also count the number of different minimum paths from any vertex to a given source vertex in a digraph...
2018-02-25 10:53:23
2720
原创 6-15 Iterative Mergesort(25 分)
6-15 Iterative Mergesort(25 分)How would you implement mergesort without using recursion?The idea of iterative mergesort is to start from N sorted sublists of length 1, and each time to merge a pair of...
2018-02-24 13:43:31
2695
原创 6-10 Strongly Connected Components(30 分)
6-10 Strongly Connected Components(30 分)Write a program to find the strongly connected components in a digraph.Format of functions:void StronglyConnectedComponents( Graph G, void (*visit)(Vertex V) );...
2018-02-23 20:05:33
1872
1
原创 6-14 Count Connected Components(20 分)
6-14 Count Connected Components(20 分)Write a function to count the number of connected components in a given graph.Format of functions:int CountConnectedComponents( LGraph Graph );where LGraph is def...
2018-02-22 15:47:35
2483
原创 6-13 Topological Sort(25 分)
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:type...
2018-02-21 18:07:46
976
原创 6-12 Shortest Path [2](25 分)
6-12 Shortest Path [2](25 分)Write a program to find the weighted shortest distances from any vertex to a given source vertex in a digraph. It is guaranteed that all the weights are positive.Format of ...
2018-02-19 21:36:57
1226
原创 6-11 Shortest Path [1](25 分)
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 dis...
2018-02-18 21:29:02
2214
原创 1002. A+B for Polynomials (25)
1002. A+B for Polynomials (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThis time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test...
2018-02-17 16:19:02
189
原创 1001. A+B Format (20)
1001. A+B Format (20)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueCalculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by co...
2018-02-17 16:15:32
181
原创 6-9 Sort Three Distinct Keys(20 分)
6-9 Sort Three Distinct Keys(20 分)Suppose you have an array of N elements, containing three distinct keys, "true", "false", and "maybe". Given an O(N) algorithm to rearrange the list so that all "fals...
2018-02-15 14:37:39
1477
1
原创 6-8 Percolate Up and Down(20 分)
6-8 Percolate Up and Down(20 分)Write the routines to do a "percolate up" and a "percolate down" in a binary min-heap.Format of functions:void PercolateUp( int p, PriorityQueue H );void PercolateDown(...
2018-02-14 22:43:03
1205
原创 6-7 Isomorphic(20 分)
6-7 Isomorphic(20 分)Two trees, T1 and T2, are isomorphic if T1 can be transformed into T2 by swapping left and right children of (some of the) nodes in T1. For instance, the two trees in Figure 1 are ...
2018-02-14 00:27:06
3377
原创 6-6 Level-order Traversal(25 分)
6-6 Level-order Traversal(25 分)Write a routine to list out the nodes of a binary tree in "level-order". List the root, then nodes at depth 1, followed by nodes at depth 2, and so on. You must do this ...
2018-02-13 12:09:54
2258
原创 6-5 Evaluate Postfix Expression(25 分)
6-5 Evaluate Postfix Expression(25 分)Write a program to evaluate a postfix expression. You only have to handle four kinds of operators: +, -, x, and /.Format of functions:ElementType EvalPostfix( char...
2018-02-12 15:46:45
1864
原创 6-4 Reverse Linked List(20 分)
6-4 Reverse Linked List(20 分)Write a nonrecursive procedure to reverse a singly linked list in O(N) time using constant extra space.Format of functions:List Reverse( List L );where List is defined as...
2018-02-11 11:16:17
2937
原创 6-3 Add Two Polynomials(20 分)
6-3 Add Two Polynomials(20 分)Write a function to add two polynomials. Do not destroy the input. Use a linked list implementation with a dummy head node. Note: The zero polynomial is represented by an ...
2018-02-11 11:14:28
1857
1
原创 6-2 Two Stacks In One Array(20 分)
6-2 Two Stacks In One Array(20 分)Write routines to implement two stacks using only one array. Your stack routines should not declare an overflow unless every slot in the array is used.Format of functi...
2018-02-11 11:11:20
1727
原创 6-1 Deque(25 分)
6-1 Deque(25 分)A "deque" is a data structure consisting of a list of items, on which the following operations are possible:Push(X,D): Insert item X on the front end of deque D.Pop(D): Remove the front...
2018-02-11 11:07:47
2134
空空如也
求助..缺少类型说明符 - 假定为 int.注意: C++ 不支持默认 int
2017-07-27
TA创建的收藏夹 TA关注的收藏夹
TA关注的人