1127 ZigZagging on a Tree (30 分) ZigZagging on a Tree题目描述:Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. 1970-01-01 PAT刷题 c++
1151 LCA in a Binary Tree (30 分) LCA in a Binary Tree题目描述:The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a binary tree, you are suppose 1970-01-01 PAT刷题 c++
1131 Subway Map (30 分) Subway Map题目描述:In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing subway. Now you are supposed to help 1970-01-01 PAT刷题 c++
1159 Structure of a Binary Tree (30 分) Structure of a Binary Tree题目描述:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, a binary tree can be uniquely determined. 1970-01-01 PAT刷题 c
1143 Lowest Common Ancestor (30 分) Lowest Common Ancestor题目描述:The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. A binary search tree (BST) is recursively defined a 1970-01-01 PAT刷题 c++
1135 Is It A Red-Black Tree (30 分) Is It A Red-Black Tree题目描述: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 1970-01-01 PAT刷题 c++
1155 Heap Paths (30 分) Heap Paths题目描述:In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than 1970-01-01 PAT刷题 c++
1161 Merging Linked Lists (25 分) Merging Linked Lists题目描述:Given two singly linked lists L1=a1→a2→⋯→a**n−1→a**n and L2=b1→b2→⋯→b**m−1→b**m. If n≥2m, you are supposed to reverse and merge the shorter one into the longer one to obtain a 1970-01-01 PAT刷题 c++
1167 Cartesian Tree (30 分) Cartesian Tree题目描述:A Cartesian tree is a binary tree constructed from a sequence of distinct numbers. The tree is heap-ordered, and an inorder traversal returns the original sequence. For example, giv 1970-01-01 PAT刷题 c++
1163 Dijkstra Sequence (30 分) Dijkstra Sequence题目描述:Dijkstra’s algorithm is one of the very famous greedy algorithms. It is used for solving the single source shortest path problem which gives the shortest paths from one particula 1970-01-01 PAT刷题 c++