摘要: Description:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Su... 阅读全文
posted @ 2015-06-21 17:57 Rosanne 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Description:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum e... 阅读全文
posted @ 2015-06-21 17:53 Rosanne 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Description:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Code:1 void revers... 阅读全文
posted @ 2015-06-21 17:38 Rosanne 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Description:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Code: 1 bool hasCycle(ListNo... 阅读全文
posted @ 2015-06-21 17:27 Rosanne 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Description:Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary word... 阅读全文
posted @ 2015-06-21 17:23 Rosanne 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Dscription:Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear r... 阅读全文
posted @ 2015-06-21 17:14 Rosanne 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Description:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtim... 阅读全文
posted @ 2015-06-21 16:58 Rosanne 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Description:Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surro... 阅读全文
posted @ 2015-06-21 16:46 Rosanne 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Description:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a... 阅读全文
posted @ 2015-06-21 16:27 Rosanne 阅读(181) 评论(0) 推荐(0) 编辑