DFS
Oliver_H_
这个作者很懒,什么都没留下…
展开
-
1053 Path of Equal Weight(DFS+weight)
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 of all the nodes along the path from R ...原创 2019-08-26 09:14:44 · 149 阅读 · 0 评论 -
1004 Counting Leaves(DFS+height)
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each input file contains one test case. Each case starts w...原创 2019-08-26 10:38:44 · 94 阅读 · 0 评论 -
1079 Total Sales of Supply Chain(DFS+height+v.resize(n))
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...原创 2019-08-26 18:10:33 · 116 阅读 · 0 评论 -
1094 The Largest Generation(DFS+height)
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...原创 2019-08-26 21:18:46 · 82 阅读 · 0 评论 -
1030 Travel Plan(经典Dijkstra+DFS)
A traveler’s map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path b...原创 2019-08-30 18:12:39 · 219 阅读 · 0 评论 -
1090 Highest Price in Supply Chain(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 the...原创 2019-09-03 11:38:59 · 109 阅读 · 0 评论 -
1115 Counting Nodes in a BST(建BST+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 nodes with keys less than or equal to the node’s key. Th...原创 2019-09-03 17:04:59 · 96 阅读 · 0 评论