摘要: Problem Definition: 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?思路:为了达到O(1)... 阅读全文
posted @ 2015-07-15 19:30 曾可爱 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Problem Definition: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definiti... 阅读全文
posted @ 2015-07-15 16:28 曾可爱 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Problem Definition: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked... 阅读全文
posted @ 2015-07-15 16:10 曾可爱 阅读(135) 评论(0) 推荐(0) 编辑