摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space? 关于cycle,第一个想法自然就是用hashmap来做。注意用hashmap.p... 阅读全文
posted @ 2015-08-19 15:22 李小橘er 阅读(159) 评论(0) 推荐(0)
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le... 阅读全文
posted @ 2015-08-19 13:50 李小橘er 阅读(142) 评论(0) 推荐(0)
摘要: Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le... 阅读全文
posted @ 2015-08-19 11:36 李小橘er 阅读(172) 评论(0) 推荐(0)
摘要: Write a program to find then-th ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For example,1, 2, 3, 4, 5, 6, 8... 阅读全文
posted @ 2015-08-19 10:41 李小橘er 阅读(211) 评论(0) 推荐(0)
摘要: Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For examp... 阅读全文
posted @ 2015-08-19 09:32 李小橘er 阅读(212) 评论(0) 推荐(0)