码迷,mamicode.com
首页 >  
搜索关键字:in place    ( 1961个结果
leetcode:Reorder List
问题 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
【leetcode】Remove Duplicates from Sorted Array
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
Leetcode:Reverse Linked List II 单链表区间范围内逆置
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
OO虚函数的一些设计手法
1. 抽象类法(VCL不推荐);第一,允许创建抽象类对象,因为语法没问题,但允许其错误。第二,接口更好。第三,如果是混合抽象类,则推荐Place Holder方法2. Place Holder(占位):父类虚拟函数为空白函数,但不是抽象方法。例如TCanvas。避免了抽象类的缺点3. 逐渐增加法:子...
分类:其他好文   时间:2014-05-19 23:15:49    阅读次数:374
Leetcode | Remove Duplicates from Sorted Array I && II
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
LeetCode: Remove Duplicates from Sorted Array [025]
【题目】 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
LeetCode: Remove Element [026]
【题目】 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
HDU 2795 Billboard (RE的可以看一看)
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
CareerCup之1.6 Rotate Image
【题目】 原文: 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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!