LeetCode OJ
黑黑的小白羊
这个作者很懒,什么都没留下…
展开
-
Maximum Depth of Binary Tree
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原创 2014-09-27 22:48:41 · 367 阅读 · 0 评论 -
Reverse Integer
public class Solution { public int reverse(int x) { if (x == Integer.MIN_VALUE) return Integer.MIN_VALUE; int result = 0; int num = Math.abs(x); while原创 2014-09-28 00:17:46 · 366 阅读 · 0 评论 -
Same Tree
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原创 2014-09-27 23:10:25 · 262 阅读 · 0 评论 -
Single Number
Single Number Total Accepted: 37050 Total Submissions: 80614My Submissions Given an array of integers, every element appears twice except for one. Find that single one. Note: Your alg原创 2014-09-27 22:15:19 · 334 阅读 · 0 评论 -
Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (i原创 2014-10-02 20:22:54 · 365 阅读 · 0 评论