摘要: 题目:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next poi... 阅读全文
posted @ 2015-09-16 11:38 savageclc26 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].... 阅读全文
posted @ 2015-09-15 21:35 savageclc26 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].代... 阅读全文
posted @ 2015-09-15 21:34 savageclc26 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the a... 阅读全文
posted @ 2015-09-15 10:55 savageclc26 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目:Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: ... 阅读全文
posted @ 2015-09-14 21:23 savageclc26 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedi... 阅读全文
posted @ 2015-09-13 23:30 savageclc26 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 题目:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit... 阅读全文
posted @ 2015-09-12 16:39 savageclc26 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:分析:简单的递归或者广度优先搜索就行代码:递归方法 ... 阅读全文
posted @ 2015-09-10 22:28 savageclc26 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 题目: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... 阅读全文
posted @ 2015-09-03 08:55 savageclc26 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3... 阅读全文
posted @ 2015-09-02 22:39 savageclc26 阅读(124) 评论(0) 推荐(0) 编辑