11 2014 档案

摘要:Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime 阅读全文
posted @ 2014-11-27 21:15 Mr.do 阅读(112) 评论(0) 推荐(0)
摘要:Given an array of integers, every element appears twice except for one. Find that single one. Your algorithm should have a linear runtime complexity. 阅读全文
posted @ 2014-11-27 14:58 Mr.do 阅读(128) 评论(0) 推荐(0)
摘要:Given inorder and postorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree. 阅读全文
posted @ 2014-11-25 17:09 Mr.do 阅读(187) 评论(0) 推荐(0)
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree. 阅读全文
posted @ 2014-11-25 17:00 Mr.do 阅读(210) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2014-11-23 13:57 Mr.do 阅读(92) 评论(0) 推荐(0)
摘要: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). For 阅读全文
posted @ 2014-11-22 14:04 Mr.do 阅读(127) 评论(0) 推荐(0)
摘要: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 { 阅读全文
posted @ 2014-11-20 17:24 Mr.do 阅读(105) 评论(0) 推荐(0)
摘要:Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, return [3,2,1].Note: Recursive sol 阅读全文
posted @ 2014-11-14 15:30 Mr.do 阅读(102) 评论(0) 推荐(0)
摘要:Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, return [1,3,2].Note: Recursive solut 阅读全文
posted @ 2014-11-14 15:22 Mr.do 阅读(105) 评论(0) 推荐(0)
摘要:Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, return [1,2,3]. Note: Recursive sol 阅读全文
posted @ 2014-11-14 15:07 Mr.do 阅读(108) 评论(0) 推荐(0)
摘要:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: But the fol 阅读全文
posted @ 2014-11-12 21:17 Mr.do 阅读(84) 评论(0) 推荐(0)
摘要:Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept 阅读全文
posted @ 2014-11-11 17:58 Mr.do 阅读(120) 评论(0) 推荐(0)
摘要:Given a linked list, remove the nth node from the end of list and return its head. For example, Note: Given n will always be valid. Try to do this in 阅读全文
posted @ 2014-11-10 20:36 Mr.do 阅读(101) 评论(0) 推荐(0)
摘要:Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't ma 阅读全文
posted @ 2014-11-06 12:14 Mr.do 阅读(112) 评论(0) 推荐(0)
摘要:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1-> 阅读全文
posted @ 2014-11-05 10:38 Mr.do 阅读(116) 评论(0) 推荐(0)
摘要:Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array A = [1,1,1,2,2,3], Your function shou 阅读全文
posted @ 2014-11-03 17:31 Mr.do 阅读(116) 评论(0) 推荐(0)
摘要:Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3-> 阅读全文
posted @ 2014-11-02 09:36 Mr.do 阅读(122) 评论(0) 推荐(0)
摘要:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2014-11-01 15:50 Mr.do 阅读(102) 评论(0) 推荐(0)