Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is t[……]
分类:PAT
PAT1115 Counting Nodes in a BST (30)-PAT甲级真题(二叉树的遍历,dfs)
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:
- The left subtree of a node contains only node[……]
PAT 1131. Subway Map (30) -甲级(图的遍历,DFS)
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 su[……]
PAT1130(DFS)
Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operat[……]
PAT 1015 Reversible Primes (20分)
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system[……]