dfs

• LeetCode 22. 括号生成

题目数字 n 代表生成括号的对数，请你设计一个函数，用于能够生成所有可能的并且 有效的 括号组合。 示例：输入：n = 3输出：["((()))","(()())","(())()","()(())","()(

查看全文

查看全文
• PAT A1162 Postfix Expression (25point(s))

Given a syntax tree (binary), you are supposed to output the corresponding postfix expression, with parentheses reflecting the precedences of the oper

查看全文
• PAT A1090 Highest Price in Supply Chain (25point(s))

A supply chain is a network of retailers（零售商）, distributors（经销商）, and suppliers（供应商）-- everyone involved in moving a product from supplier to customer

查看全文

查看全文
• PAT A1131 Subway Map (30point(s))

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

查看全文
• PAT A1127 ZigZagging on a Tree (30point(s))

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 ino

查看全文
• PAT A1126 Eulerian Path (25point(s))

In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Similarly, an Eulerian circuit is an Eulerian path which

查看全文
• PAT A1115 Counting Nodes in a BST (30point(s))

ABinarySearchTree(BST)isrecursivelydefinedasabinarytreewhichhasthefollowingproperties:Theleftsubtreeofanodecontainsonlynodeswithkeyslessthanorequaltot

查看全文
• PAT A1111 Online Map (30point(s))

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

查看全文