2014年12月23日
摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2014-12-23 00:03 Chris兔的小佳佳 阅读(108) 评论(0) 推荐(0)
  2014年12月22日
摘要: Determine whether an integer is a palindrome. Do this without extra space.对于这道题不能用额外的空间,即不能用一个数组来保存各个位数,因此对于这种问题可以采用判断两头数字的方法 1 package Palindrome.Num... 阅读全文
posted @ 2014-12-22 21:26 Chris兔的小佳佳 阅读(108) 评论(0) 推荐(0)
  2014年12月4日
摘要: 一个线程在未正常结束之前, 被强制终止是很危险的事情. 因为它可能带来完全预料不到的严重后果. 所以你看到Thread.suspend, Thread.stop等方法都被Deprecated了那么不能直接把一个线程搞挂掉, 但有时候又有必要让一个线程死掉, 或者让它结束某种等待的状态 该怎么办呢? ... 阅读全文
posted @ 2014-12-04 22:14 Chris兔的小佳佳 阅读(1264) 评论(0) 推荐(0)
  2014年11月30日
摘要: Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv... 阅读全文
posted @ 2014-11-30 20:17 Chris兔的小佳佳 阅读(138) 评论(0) 推荐(0)
  2014年11月25日
摘要: There areNchildren standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requi... 阅读全文
posted @ 2014-11-25 15:51 Chris兔的小佳佳 阅读(114) 评论(0) 推荐(0)
摘要: Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity... 阅读全文
posted @ 2014-11-25 13:12 Chris兔的小佳佳 阅读(138) 评论(0) 推荐(0)
摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp... 阅读全文
posted @ 2014-11-25 13:08 Chris兔的小佳佳 阅读(119) 评论(0) 推荐(0)
  2014年11月23日
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文
posted @ 2014-11-23 22:16 Chris兔的小佳佳 阅读(140) 评论(0) 推荐(0)
摘要: Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl... 阅读全文
posted @ 2014-11-23 16:07 Chris兔的小佳佳 阅读(158) 评论(0) 推荐(0)
  2014年11月20日
摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?这道题用来判断链表中是否有循环,最开始我想的是遍历链表,同时用一个list保存遍历过... 阅读全文
posted @ 2014-11-20 23:28 Chris兔的小佳佳 阅读(127) 评论(0) 推荐(0)