- 博客(5)
- 收藏
- 关注
原创 1135. Is It A Red-Black Tree (30)-PAT甲级真题
There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties: (1) Every node is either red or black.(2) The root is black.(3) Every lea...
2017-09-20 09:54:34 3810 19
原创 1134. Vertex Cover (25)-PAT甲级真题
A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with several vertex sets, you are supposed to tell if e
2017-09-20 09:53:57 4030 6
原创 1075. 链表元素分类(25)-PAT乙级真题
给定一个单链表,请编写程序将链表元素进行分类排列,使得所有负值元素都排在非负值元素的前面,而[0, K]区间内的元素都排在大于K的元素前面。但每一类内部元素的顺序是不能改变的。例如:给定链表为 18→7→-4→0→5→-6→10→11→-2,K为10,则输出应该为 -4→-6→-2→7→0→5→10→18→11。 输入格式: 每个输入包含1个测试用例。每个测试用例第1行给出:第1个结点的地址;
2017-09-20 09:53:09 4482 15
原创 1133. Splitting A Linked List (25)-PAT甲级真题
Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all the values in [0, K] appear before all those grea
2017-09-20 09:52:42 3486 1
原创 1132. Cut Integer (20)-PAT甲级真题
Cutting an integer means to cut a K digits long integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesting
2017-09-20 09:51:19 2432 4
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人