问题描述:
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?
基本思路:
此题要求矩阵顺时针转90度。可以找出元素选择规律:
i‘ = j;
j...
分类:
其他好文 时间:
2014-11-19 11:26:21
阅读次数:
128
问题描述:
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?
基本思路:
此题要求矩阵顺时针转90度。可以找出元素选择规律:
i‘ = j;
j...
分类:
其他好文 时间:
2014-11-19 01:24:29
阅读次数:
154
Wireless Network
Time Limit: 10000MS
Memory Limit: 65536K
Total Submissions: 16832
Accepted: 7068
Description
An earthquake takes place in Southeast Asia. The ACM (...
分类:
Web程序 时间:
2014-11-18 01:40:07
阅读次数:
223
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-11-18 00:05:29
阅读次数:
287
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.For exam...
分类:
其他好文 时间:
2014-11-17 22:40:48
阅读次数:
231
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-11-17 14:01:44
阅读次数:
173
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 itto {1,4,...
分类:
其他好文 时间:
2014-11-17 10:45:06
阅读次数:
179
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up: Did you use extra spac...
分类:
其他好文 时间:
2014-11-17 00:23:53
阅读次数:
244
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.For exam...
分类:
其他好文 时间:
2014-11-16 18:33:18
阅读次数:
200
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.For exam...
分类:
其他好文 时间:
2014-11-16 14:41:01
阅读次数:
280