![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 79
izuji
越努力,越幸运
展开
-
[LeetCode]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's key.Th原创 2014-11-16 18:55:10 · 222 阅读 · 0 评论 -
[LeetCode] Binary Tree Maximum Path Sum
Given a binary tree, find the maximum pathsum.The path may start and end at any node inthe tree.For example:Given the below binary tree, Return 6 . 分析一:刚开始想到的方法是:参照求解最大连续子数组和的方式,用递归求解原创 2014-11-16 16:28:14 · 249 阅读 · 0 评论 -
[LeetCode] Surrounded Regions
Given a 2D board containing 'X' and 'O', capture allregions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's inthat surrounded region.For example,Afterrunning your functio原创 2014-11-17 14:10:52 · 212 阅读 · 0 评论 -
[LeetCode] Decode Ways
A message containing letters from A-Z isbeing encoded to numbers using the following mapping:Given an encoded message containing digits,determine the total number of ways to decode it.For exam原创 2014-11-17 18:27:11 · 197 阅读 · 0 评论 -
[LeetCode] Spiral Matrix
Given a matrix of m x n elements (m rows, ncolumns), return all elements of the matrix in spiral order. For example,Given the following matrix:You should return [1,2,3,6,9,8,7,4,5]. 分析:原创 2014-11-18 20:14:02 · 206 阅读 · 0 评论