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...
分类:
其他好文 时间:
2015-05-28 09:27:21
阅读次数:
138
House Robber II问题:Note:This is an extension ofHouse Robber.After robbing those houses on that street, the thief has found himself a new place for his ...
分类:
其他好文 时间:
2015-05-28 00:42:45
阅读次数:
158
Codeforces Round #298 (Div. 2), problem: (A) Exam
An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i?+?1) always studied side...
分类:
其他好文 时间:
2015-05-27 10:19:29
阅读次数:
150
Wireless NetworkTime Limit:10000MSMemory Limit:65536KTotal Submissions:18066Accepted:7618DescriptionAn earthquake takes place in Southeast Asia. The A...
分类:
Web程序 时间:
2015-05-25 23:45:35
阅读次数:
250
Set Matrix Zeroes
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
因为没有额外的空间,我们可以采用第一个0元素所在的行和列来保存0元素的信息。void setZeroes(vector<vector>& matrix) {...
分类:
编程语言 时间:
2015-05-25 13:08:36
阅读次数:
155
支持In-Place操作cvDilatecvMorphologyEx对于“礼帽”和“黑帽”操作,in-place情况下,临时图像是必须的
分类:
其他好文 时间:
2015-05-24 14:13:49
阅读次数:
128
Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened ...
分类:
编程语言 时间:
2015-05-23 22:40:17
阅读次数:
190
Given a singly linked listL: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. 1 #incl...
分类:
其他好文 时间:
2015-05-23 21:23:55
阅读次数:
231
House Robber II
Note: This is an extension of House Robber.
After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much...
分类:
其他好文 时间:
2015-05-23 00:07:43
阅读次数:
136
Rotate Image
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
解题思路:
题目要求原地算法。假设坐标轴如上所示。顺时针...
分类:
其他好文 时间:
2015-05-23 00:05:24
阅读次数:
212