摘要: Problem:Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem a... 阅读全文
posted @ 2015-06-16 21:51 尾巴草 阅读(156) 评论(0) 推荐(0) 编辑
摘要: problem:Reverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?solution:头插法逆转链表/*... 阅读全文
posted @ 2015-06-16 19:56 尾巴草 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return... 阅读全文
posted @ 2015-06-16 19:29 尾巴草 阅读(100) 评论(0) 推荐(0) 编辑
摘要: problem:Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321solution:逐个取数字; 处理溢出问题 (INT_MIN INT_MAX)class Soluti... 阅读全文
posted @ 2015-06-16 19:08 尾巴草 阅读(102) 评论(0) 推荐(0) 编辑
摘要: problem:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one uniqu... 阅读全文
posted @ 2015-06-16 16:46 尾巴草 阅读(131) 评论(0) 推荐(0) 编辑