自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 113. Path Sum II

题目Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5

2017-04-30 19:33:11 188

原创 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

2017-04-30 17:56:03 3017

转载 LeetCode(110)Balanced Binary Tree

/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ cl

2017-04-30 14:31:59 226

转载 111. Minimum Depth of Binary Tree

题目Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.翻译给定二叉树,找到最小深度。最

2017-04-30 14:29:06 175

原创 108. Convert Sorted Array to Binary Search Tree

题目Given an array where elements are sorted in ascending order, convert it to a height balanced BST.翻译给定一个数组,其中元素按升序排序,将其转换为平衡BST的高度。分析平衡二叉树就是若任意节点的左子树不空,则左子树上所有结点的值均小于它的根结点的值;若任意节点

2017-04-30 13:03:29 205

原创 105. Construct Binary Tree from Preorder and Inorder Traversal

题目Given preorder and inorder traversal of a tree, construct the binary tree翻译根据前序遍历和中序遍历重建二叉树分析将之前在数据结构上所学的通过前序和中序写出二叉树融入进来1.确定根节点,然后以根节点来进行递归,前序遍历的根节点为第一个。2.求解树的子树,中序遍历中根左边为左子树,右边

2017-04-29 10:49:31 259

原创 104. Maximum Depth of Binary Tree Add to List DescriptionHintsSubmissions

题目Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.翻译给定一个二叉树,找到其最大深度。

2017-04-25 21:02:36 222

原创 103. Binary Tree Zigzag Level Order Traversal

题目Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given

2017-04-25 20:23:53 320

原创 102. Binary Tree Level Order Traversal

题目Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3 /

2017-04-25 16:41:42 211

原创 101. Symmetric Tree

题目Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3

2017-04-23 20:26:24 189

原创 100. Same Tree

题目Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.翻译

2017-04-20 17:52:39 181

原创 98. Validate Binary Search Tree

题目Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node'

2017-04-18 16:13:49 205

原创 96. Unique Binary Search Trees

题目Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2

2017-04-18 16:05:59 186

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除