TimeX
Subscribe
Tagged

二叉树

A collection of 2 posts

leetcode

[leetcode]112. Path Sum

问题描述: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ \ 7 2 1 return

  • xinyu
xinyu Oct 5, 2020 • 2 min read
leetcode

【leetcode】606. Construct String from Binary Tree

【题目】 You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be represented by empty parenthesis pair "()". And you need to omit all the empty parenthesis pairs that don't affect the one-to-one mapping

Zhao Lei Sep 25, 2020 • 3 min read
TimeX © 2023
  • 博客首页
Powered by Ghost