摘要: 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)
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 这道题还是很有... 阅读全文
posted @ 2015-08-18 17:03 李小橘er 阅读(199) 评论(0) 推荐(0)
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2015-08-18 15:42 李小橘er 阅读(207) 评论(0) 推荐(0)
摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2015-08-18 12:47 李小橘er 阅读(154) 评论(0) 推荐(0)
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2015-08-18 12:35 李小橘er 阅读(169) 评论(0) 推荐(0)
摘要: Given a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 ... 阅读全文
posted @ 2015-08-18 10:05 李小橘er 阅读(212) 评论(0) 推荐(0)