摘要: Description:Given acompletebinary tree, count the number of nodes.In a complete binary tree every level, except possibly the last, is completely fille... 阅读全文
posted @ 2015-08-13 23:29 Pickle 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Description: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... 阅读全文
posted @ 2015-08-13 00:50 Pickle 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Description:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?判断一个单向链表是不是回文。思路:最简单的思路就... 阅读全文
posted @ 2015-08-13 00:29 Pickle 阅读(180) 评论(0) 推荐(0) 编辑