码迷,mamicode.com
首页 >  
搜索关键字:in-place    ( 1961个结果
leetcode[73]Set Matrix Zeroes
Given amxnmatrix, 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?A s...
分类:其他好文   时间:2015-02-09 15:40:55    阅读次数:176
leetcode[92]Reverse Linked List II
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...
分类:其他好文   时间:2015-02-09 14:03:34    阅读次数:132
LeetCode 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.Follow up:Did you use extra space?A straight forward solution using O(mn) space is probably a bad idea.A si...
分类:其他好文   时间:2015-02-09 12:53:24    阅读次数:217
leetcode------Set Matrix Zeroes
标题:Set Matrix Zeroes通过率:31.3%难度:中等Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Fol...
分类:其他好文   时间:2015-02-09 12:43:33    阅读次数:108
7. 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...
分类:其他好文   时间:2015-02-09 09:23:32    阅读次数:176
[LeetCode] Remove Element
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-02-08 15:26:43    阅读次数:145
LeetCode 048 Rotate Image
题目要求:Rotate ImageYou are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?代码...
分类:其他好文   时间:2015-02-07 21:32:30    阅读次数:204
LeetCode 026 Remove Duplicates from Sorted Array
题目描述:Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new ...
分类:其他好文   时间:2015-02-07 17:18:43    阅读次数:140
LeetCode 027 Remove Element
题目要求:Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be chan...
分类:其他好文   时间:2015-02-07 17:11:25    阅读次数:146
基础算法之插入排序Insertion Sort
原理通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入。通常采用in-place排序(即只需用到O(1)的额外空间的排序),因而在从后向前扫描过程中,需要反复把已排序元素逐步向后挪位,为最新元素提供插入空间。相信大家都打过扑克牌,很好理解。例子将数组[5,6,3,1,8...
分类:编程语言   时间:2015-02-06 18:24:45    阅读次数:108
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!