码迷,mamicode.com
首页 >  
搜索关键字:in-place    ( 1961个结果
实现 memcpy 函数
memcpy() 的解释:void* memcpy(void* dst, const void* src, size_t n);// if copying takes place between objects that overlap, the behavior is undefined.因此自己...
分类:其他好文   时间:2014-06-07 04:35:21    阅读次数:551
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-06-04 21:38:05    阅读次数:233
Rotate Image
You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?classSolution{publi...
分类:其他好文   时间:2014-06-04 20:25:09    阅读次数:227
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...
分类:其他好文   时间:2014-06-04 18:55:07    阅读次数:343
【LeetCode】Rotate Image
Rotate ImageYou 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?最简...
分类:其他好文   时间:2014-05-29 23:02:38    阅读次数:254
LeetCode: Rotate Image [047]
【题目】 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? 【题意】 给定一个nXn的二维矩阵,按时钟方向旋转90度,不能使用额外的数据结构 【思路】 从外向内逐层旋转...
分类:其他好文   时间:2014-05-26 05:50:25    阅读次数:266
HDU4430:Yukari's Birthday(二分)
Problem Description Today is Yukari's n-th birthday. Ran and Chen hold a celebration party for her. Now comes the most important part, birthday cake! But it's a big challenge for them to place n ca...
分类:其他好文   时间:2014-05-26 04:38:35    阅读次数:239
【LeetCode】Remove Duplicates from Sorted Array
Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new len...
分类:其他好文   时间:2014-05-25 19:08:31    阅读次数:203
【Leetcode】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...
分类:其他好文   时间:2014-05-21 19:08:08    阅读次数:195
排序算法汇总总结_Java实现
一、插入排序直接插入排序(InsertionSort)的算法描述是一种简单直观的排序算法。它的工作原理是通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入。插入排序在实现上,通常采用in-place排序(即只需用到O(1)的额外空间的排序),因而在从后..
分类:编程语言   时间:2014-05-21 12:47:23    阅读次数:503
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!