上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页
摘要: Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return... 阅读全文
posted @ 2014-12-04 16:59 陆草纯 阅读(1397) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ... 阅读全文
posted @ 2014-12-02 21:09 陆草纯 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Unique Binary Search Trees IIGivenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your pr... 阅读全文
posted @ 2014-12-02 20:02 陆草纯 阅读(2722) 评论(0) 推荐(0) 编辑
摘要: Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a to... 阅读全文
posted @ 2014-12-02 18:31 陆草纯 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Interleaving StringGivens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", r... 阅读全文
posted @ 2014-12-02 16:32 陆草纯 阅读(4850) 评论(0) 推荐(0) 编辑
摘要: Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtre... 阅读全文
posted @ 2014-12-02 14:44 陆草纯 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A sol... 阅读全文
posted @ 2014-12-02 13:00 陆草纯 阅读(830) 评论(0) 推荐(0) 编辑
摘要: Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ide... 阅读全文
posted @ 2014-12-01 22:57 陆草纯 阅读(4659) 评论(0) 推荐(1) 编辑
摘要: Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric... 阅读全文
posted @ 2014-12-01 13:25 陆草纯 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Level Order TraversalGiven a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).Fo... 阅读全文
posted @ 2014-11-30 20:12 陆草纯 阅读(226) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 27 下一页