- 博客(7)
- 收藏
- 关注
原创 1106 Lowest Price in Supply Chain (25 分)【dfs】
A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on th...
2019-01-07 10:55:38 241
原创 1099 Build A Binary Search Tree (30 分)【中序+层序】
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 nodes with keys less than the node's key. The right su...
2019-01-06 13:49:37 279
原创 1090 Highest Price in Supply Chain (25 分)【dfs】
A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on th...
2019-01-05 15:11:42 612
原创 1110 Complete Binary Tree (25 分)【完全二叉树(dfs)】
Given a tree, you are supposed to tell if it is a complete binary tree.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (≤20) wh...
2019-01-04 15:51:49 325
原创 1151 LCA in a Binary Tree (30 分)【最小公共祖先】
1151 LCA in a Binary Tree (30 分)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 a...
2019-01-03 15:20:37 766 4
原创 1086 Tree Traversals Again (25 分)【前序中序转为后序】
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the s...
2019-01-02 20:26:06 300
原创 1155 Heap Paths (30 分)【dfs】
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 or equal to (i...
2019-01-02 16:52:47 217
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人