2015年8月6日

Leetcode解题思想总结篇:双指针

摘要: Leetcode解题思想总结篇:双指针===#1概念双指针:快慢指针。快指针在每一步走的步长要比慢指针一步走的步长要多。快指针通常的步速是慢指针的2倍。在循环中的指针移动通常为:`faster = faster.next.next; slower = slower.next; `# 2 应用## 2... 阅读全文

posted @ 2015-08-06 17:37 BYRHuangQiang 阅读(7408) 评论(0) 推荐(2) 编辑

leetcode面试准备: CountPrimes

摘要: # 1 题目> Description:Count the number of prime numbers less than a non-negative number, n.**接口**:`public int countPrimes(int n);`# 2 思路统计小于n的素数个数,注意不包括... 阅读全文

posted @ 2015-08-06 11:24 BYRHuangQiang 阅读(701) 评论(0) 推荐(0) 编辑

导航