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
阅读全文
摘要:Given an array of integers, every element appears twice except for one. Find that single one. Your algorithm should have a linear runtime complexity.
阅读全文
摘要:Given inorder and postorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree.
阅读全文
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree.
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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 {
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->
阅读全文
摘要: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
阅读全文
摘要: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->
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号