IncredibleThings

导航

2016年6月1日 #

LeetCode-Valid Anagram

摘要: 二刷: 阅读全文

posted @ 2016-06-01 06:10 IncredibleThings 阅读(137) 评论(0) 推荐(0) 编辑

LeetCode-Delete Node in a Linked List

摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value ... 阅读全文

posted @ 2016-06-01 05:54 IncredibleThings 阅读(100) 评论(0) 推荐(0) 编辑

LeetCode-Lowest Common Ancestor of a Binary Search Tree

摘要: 思路,先判断入口是否有非法输入。 1 如果某一个root==p || root == q,那么LCA肯定是root(因为是top down,LCA肯定在root所囊括的树上,而root又是p q其中一个节点了,那么另外一个节点肯定在root之下,那么root就是LCA),那么返回root 2 如果r 阅读全文

posted @ 2016-06-01 05:53 IncredibleThings 阅读(121) 评论(0) 推荐(0) 编辑