Leetcode
July树树
每个人都会变成自己最讨厌的样子。
展开
-
Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the...原创 2019-12-06 15:05:56 · 128 阅读 · 0 评论 -
Maximum Depth of Binary Tree
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. Note:A leaf is a node with no childre...原创 2019-12-06 14:52:57 · 96 阅读 · 0 评论 -
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 4 4 3 ...原创 2019-12-06 14:49:47 · 108 阅读 · 0 评论 -
Same Tree
Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical and the nodes have the same value. Example ...原创 2019-12-06 14:36:15 · 306 阅读 · 0 评论 -
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 keysless thanthe node's key. The ...原创 2019-12-05 16:06:40 · 107 阅读 · 0 评论 -
Two Sum
Given an array of integers, returnindicesof the two numbers such that they add up to a specific target. You may assume that each input would haveexactlyone solution, and you may not use thesame...原创 2019-12-05 14:13:22 · 125 阅读 · 0 评论 -
Container With Most Water
地址:https://leetcode.com/problems/container-with-most-water/ Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that t...原创 2019-12-05 00:10:53 · 107 阅读 · 0 评论