# 归档 2015年7月

## 题目描述：

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.

According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes v and w as the ...

## 题目描述：

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.

According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes v and w ...

## 题目描述：

Given a linked list, return the node where the cycle begins. If there is no cycle, return null.

Can you solve it without using extra space?

## 题目描述：

Given a singly linked list, determine if it is a palindrome.

Could you do it in O(n) time and O(1) space?

## 解题思路：

1). 使用快慢指针寻找链表中点

2). 将链表的后半部分就地逆置 ...

## 题目描述：

Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.

For example:

Given n = 13,

Return 6, because digit 1 occurred in the following numbers: 1, 10 ...