
树
逃课去学习:)
读万卷书,行万里路。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT(树)——1020 Tree Traversals (25 分)
1020 Tree Traversals (25 分) Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order t...原创 2019-01-20 13:48:38 · 205 阅读 · 0 评论 -
PAT(树)——1053 Path of Equal Weight (30 分)
1053 Path of Equal Weight (30 分) Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti . The weight of a path from R to L is defined to be the sum of the weights ...原创 2019-01-20 16:06:37 · 211 阅读 · 0 评论 -
PAT(树)——1079 Total Sales of Supply Chain (25 分)
1079 Total Sales of Supply Chain (25 分) A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer. Starting...原创 2019-01-20 16:36:26 · 122 阅读 · 0 评论 -
PAT(树)——1086 Tree Traversals Again (25 分)
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 f...原创 2019-01-21 11:58:39 · 148 阅读 · 0 评论 -
PAT(树)——1090 Highest Price in Supply Chain (25 分)
1090 Highest Price in Supply Chain (25 分) A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer. Starti...原创 2019-01-21 15:37:51 · 337 阅读 · 0 评论 -
PAT(树)——1094 The Largest Generation (25 分)
1094 The Largest Generation (25 分) A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation w...原创 2019-01-21 16:19:16 · 137 阅读 · 0 评论 -
PAT(树)——1102 Invert a Binary Tree (25 分)
1102 Invert a Binary Tree (25 分) The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fu...原创 2019-01-21 17:33:05 · 144 阅读 · 0 评论 -
PAT(树)——1106 Lowest Price in Supply Chain (25 分)
1106 Lowest Price in Supply Chain (25 分) A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer. Startin...原创 2019-01-21 19:37:38 · 276 阅读 · 0 评论 -
PAT(树)——1115 Counting Nodes in a BST (30 分)
1115 Counting Nodes in a BST (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...原创 2019-01-21 20:07:13 · 406 阅读 · 0 评论