二叉树
hg_zhh0427
一个普通人
展开
-
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 fuck off.Now it’s your turn to prove原创 2017-08-02 22:38:55 · 231 阅读 · 0 评论 -
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 stac原创 2017-07-29 22:10:19 · 226 阅读 · 0 评论 -
1064. Complete Binary Search Tree (30)
Complete Binary Search Tree (30) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A Binary Search Tree (BST) is recursively defined as a binary tree which has the following原创 2017-11-12 19:24:18 · 218 阅读 · 0 评论 -
1110. Complete Binary Tree (25)完全二叉树
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) whi原创 2017-08-04 20:53:50 · 321 阅读 · 0 评论 -
1020. Tree Traversals (25)
Tree Traversals (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and in原创 2017-07-13 21:20:12 · 264 阅读 · 0 评论 -
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 from one root supplier, everyone on the ch原创 2017-07-28 08:52:03 · 284 阅读 · 0 评论 -
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.Starting from one root supplier, everyone on the ch原创 2017-07-31 11:45:22 · 214 阅读 · 0 评论 -
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 with the largest population. Input S原创 2017-07-31 22:25:42 · 249 阅读 · 0 评论 -
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 subtre原创 2017-08-01 22:05:53 · 235 阅读 · 0 评论 -
1004. Counting Leaves (30)
Counting Leaves (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members原创 2017-06-08 21:29:40 · 174 阅读 · 0 评论