【题目】You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?【analyze】1.先对角线...
分类:
其他好文 时间:
2015-05-06 17:06:14
阅读次数:
147
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2015-05-06 13:09:34
阅读次数:
88
Given an input string, reverse the string word by word.For example,
Given s = “the sky is blue”,
return “blue is sky the”.Update (2015-02-12):
For C programmers: Try to solve it in-place in O(1) s...
分类:
其他好文 时间:
2015-05-06 00:01:27
阅读次数:
188
题目描述:
Reverse 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 and n =
4,
return 1->4->3->2->5->NULL.
Note:
Given m, ...
分类:
其他好文 时间:
2015-05-05 14:34:24
阅读次数:
157
/** * Editor Wizard for easily managing global defines in Unity * Place in Assets/Editor folder, or if you choose to place elsewhere * be sure to als....
分类:
编程语言 时间:
2015-05-04 17:12:46
阅读次数:
500
题目描述
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in ...
分类:
其他好文 时间:
2015-05-04 15:35:18
阅读次数:
140
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 space...
分类:
其他好文 时间:
2015-05-04 13:45:22
阅读次数:
120
problem:
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,...
分类:
其他好文 时间:
2015-05-04 11:54:03
阅读次数:
144
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for...
分类:
编程语言 时间:
2015-05-03 21:57:40
阅读次数:
132
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...
分类:
编程语言 时间:
2015-05-03 21:46:58
阅读次数:
118