2015年1月11日

Rotate Image

摘要: You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?我直接开了一个大小相同的数组resul... 阅读全文

posted @ 2015-01-11 14:17 luckygxf 阅读(154) 评论(0) 推荐(0) 编辑

Linked List Cycle II

摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?题意判... 阅读全文

posted @ 2015-01-11 13:35 luckygxf 阅读(180) 评论(0) 推荐(0) 编辑

Search a 2D Matrix

摘要: Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l... 阅读全文

posted @ 2015-01-11 13:00 luckygxf 阅读(179) 评论(0) 推荐(0) 编辑

Sort Colors

摘要: Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文

posted @ 2015-01-11 01:11 luckygxf 阅读(171) 评论(0) 推荐(0) 编辑

Combinations

摘要: Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],... 阅读全文

posted @ 2015-01-11 00:46 luckygxf 阅读(171) 评论(0) 推荐(0) 编辑

导航