You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路:首先左右翻转,然后按照左下,右上...
分类:
其他好文 时间:
2014-09-03 19:50:47
阅读次数:
241
Description
You live in a village but work in another village. You decided to follow the straight path between your house (A) and the working place (B), but there are several rivers you need to cro...
分类:
其他好文 时间:
2014-09-03 11:22:36
阅读次数:
215
HTML5对WebForm做了许多增强,比如input新增的type类型、FormValidation等。Placeholder是HTML5新增的另一个属性,当input或者textarea设置了该属性后,该值的内容将作为灰字提示显示在文本框中,当文本框获得焦点时,提示文字消失。这里提供了Place...
分类:
Web程序 时间:
2014-09-01 17:11:33
阅读次数:
217
LeetCode: Reverse Linked ListReverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 ...
分类:
其他好文 时间:
2014-08-31 22:45:51
阅读次数:
215
UVA 11080 - Place the Guards
题目链接
题意:一些城市,之间有道路相连,现在要安放警卫,警卫能看守到当前点周围的边,一条边只能有一个警卫看守,问是否有方案,如果有最少放几个警卫
思路:二分图判定,判定过程记录下白点和黑点个数,小的就是要安放的个数,注意如果是0,那么应该是加1
代码:
#include
#include
#include...
分类:
其他好文 时间:
2014-08-31 17:20:21
阅读次数:
155
题目:
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the n...
分类:
其他好文 时间:
2014-08-31 17:20:11
阅读次数:
271
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2014-08-30 02:21:18
阅读次数:
246
Given a singly linked list L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
You must do this in-place without altering the nodes' values.
For example,
Given {1,2,3,4}, reorder it to ...
分类:
其他好文 时间:
2014-08-30 00:06:58
阅读次数:
359
class Solution: # @param matrix, a list of lists of integers # RETURN NOTHING, MODIFY matrix IN PLACE. def setZeroes(self, matrix): di...
分类:
其他好文 时间:
2014-08-29 16:00:48
阅读次数:
203
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat...
分类:
其他好文 时间:
2014-08-29 02:35:13
阅读次数:
203