问题
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}, reorde...
分类:
其他好文 时间:
2014-05-22 07:04:46
阅读次数:
298
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-05-21 20:00:51
阅读次数:
296
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, n satisfy the fol...
分类:
其他好文 时间:
2014-05-21 07:18:02
阅读次数:
301
1.
抽象类法(VCL不推荐);第一,允许创建抽象类对象,因为语法没问题,但允许其错误。第二,接口更好。第三,如果是混合抽象类,则推荐Place Holder方法2.
Place Holder(占位):父类虚拟函数为空白函数,但不是抽象方法。例如TCanvas。避免了抽象类的缺点3. 逐渐增加法:子...
分类:
其他好文 时间:
2014-05-19 23:15:49
阅读次数:
374
Remove Duplicates from Sorted Array IGiven a
sorted array, remove the duplicates in place such that each element appear only
once and return the new l...
分类:
其他好文 时间:
2014-05-19 12:10:41
阅读次数:
329
理解二进制和十六进制的最佳方法是先透彻的领悟十进制计数系统。十进制(Decimal)系统是基于10的计数系统(词根Deci-表示10)。“基于10”指的是由10个数位(Digit)0到9来表示数。
使用“位置(Place Value)”,可以用不多的几个数位(如10个十进制数位)来表示很大的数。所有...
分类:
其他好文 时间:
2014-05-18 19:56:27
阅读次数:
346
【题目】
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 place with constant memory.
For example,
Given input array A ...
分类:
其他好文 时间:
2014-05-18 18:25:19
阅读次数:
272
【题目】
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 new length.
【题意】
删除数组中指定的值。不关心在新数组的后面即数组尾部留下了什么值。
【思路】
思路同Remo...
分类:
其他好文 时间:
2014-05-18 14:53:56
阅读次数:
208
Problem Description
At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcement...
分类:
其他好文 时间:
2014-05-15 19:48:31
阅读次数:
348
【题目】
原文:
1.6 Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do this in place?
译文:
一张图像表示...
分类:
其他好文 时间:
2014-05-15 05:43:35
阅读次数:
240