Mew


  • 首页

  • 分类

  • 归档

  • 标签

Leetcode解题-Recover Binary Search Tree

发表于 2015-09-07   |   分类于 编程题   |  
描述 Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note:A solution using O(n) spac ...
阅读全文 »

Leetcode解题-Binary Tree Zigzag Level Order Traversal

发表于 2015-09-07   |   分类于 编程题   |  
描述 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 a ...
阅读全文 »

Leetcode解题-Binary Tree Level Order Traversal II

发表于 2015-09-07   |   分类于 编程题   |  
描述 Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root). F ...
阅读全文 »

Leetcode解题-Binary Tree Level Order Traversal

发表于 2015-09-07   |   分类于 编程题   |  
描述 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 ...
阅读全文 »

Leetcode解题-Binary Tree Postorder Traversal

发表于 2015-09-07   |   分类于 编程题   |  
描述 Given a binary tree, return the postorder traversal of its nodes’ values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3 ...
阅读全文 »

Leetcode解题-Binary Tree Inorder Traversal

发表于 2015-09-07   |   分类于 编程题   |  
描述 Given a binary tree, return the inorder traversal of its nodes’ values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3 ...
阅读全文 »

Leetcode解题-Binary Tree Preorder Traversal

发表于 2015-09-07   |   分类于 编程题   |  
描述 Given a binary tree, return the preorder traversal of its nodes’ values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1, ...
阅读全文 »

Leetcode解题-Evaluate Reverse Polish Notation

发表于 2015-09-07   |   分类于 编程题   |  
描述 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or anothe ...
阅读全文 »

Leetcode解题-Largest Rectangle in Histogram

发表于 2015-09-07   |   分类于 编程题   |  
描述 Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the h ...
阅读全文 »

Leetcode解题-Longest Valid Parentheses

发表于 2015-09-06   |   分类于 编程题   |  
描述 Given a string containing just the characters ‘(‘ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. For “(()”, the ...
阅读全文 »

Leetcode解题-Valid Parentheses

发表于 2015-09-06   |   分类于 编程题   |  
描述 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. The brackets must close in t ...
阅读全文 »

Leetcode解题-Length of Last Word

发表于 2015-09-06   |   分类于 编程题   |  
描述 Given a string s consists of upper/lower-case alphabets and empty space characters ‘ ‘, return the length of last word in the string. If the last w ...
阅读全文 »

Leetcode解题-Simplify Path

发表于 2015-09-06   |   分类于 编程题   |  
描述 Given an absolute path for a file (Unix-style), simplify it. For example,path = “/home/“, => “/home”path = “/a/./b/../../c/“, => “/c” Corner ...
阅读全文 »

Leetcode解题-Group Anagrams

发表于 2015-09-06   |   分类于 编程题   |  
描述 Given an array of strings, group anagrams together. For example, given: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”],Return: [ [“ate”, “eat”,”tea”], ...
阅读全文 »

Leetcode解题-Count and Say

发表于 2015-09-06   |   分类于 编程题   |  
描述 The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, … 1 is read off as “one 1” or 11.11 is read of ...
阅读全文 »
«1…678…11»
Garfieldog

Garfieldog

只有猪肉卷是永恒的

158 日志
2 分类
39 标签
RSS
github zhihu
Creative Commons
©   2015 - 2016 Garfieldog
由 Hexo 强力驱动
主题 - NexT