码迷,mamicode.com
首页 >  
搜索关键字:in-place    ( 1961个结果
LeetCode OJ 114. Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: ...
分类:其他好文   时间:2016-04-21 10:04:59    阅读次数:91
HDOJ(HDU) 1673 Optimal Parking
Problem Description When shopping on Long Street, Michael usually parks his car at some random location, and then walks to the stores he needs. Can you help Michael choose a place to park which minim...
分类:其他好文   时间:2016-04-20 02:04:18    阅读次数:163
LeetCode OJ 92. 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- ...
分类:其他好文   时间:2016-04-18 18:39:21    阅读次数:176
[CareerCup] 17.1 Swap Number In Place 互换位置
17.1 Write a function to swap a number in place (that is, without temporary variables). 这道题让我们交换两个数,但是不能用额外空间,那么我们可以先做差值,存入a中,然后再加上b,存入b中,那么此时的b即为原来的a ...
分类:其他好文   时间:2016-04-18 06:24:17    阅读次数:119
uva 11134 fabled rooks (贪心)——yhx
We would like to place n rooks, 1  n  5000, on a n  nboard subject to the following restrictions? The i-th rook can only be placed within the recta ...
分类:其他好文   时间:2016-04-17 17:40:08    阅读次数:213
排序算法
http://blog.csdn.net/xiazdong/article/details/8462393 In-place sort(不占用额外内存或占用常数的内存):插入排序、选择排序、冒泡排序、堆排序、快速排序。 Out-place sort:归并排序、计数排序、基数排序、桶排序。 stabl ...
分类:编程语言   时间:2016-04-16 18:19:03    阅读次数:281
Leetcode[26]-Remove Duplicates from Sorted Array
Link: https://leetcode.com/problems/remove-duplicates-from-sorted-array/ Given a sorted array, remove the duplicates in place such that each element a ...
分类:其他好文   时间:2016-04-15 20:20:05    阅读次数:164
Leetcode 48 Rotate Image
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? 思路:把矩阵看成是由多个 ...
分类:其他好文   时间:2016-04-12 00:03:53    阅读次数:215
(Array)27. Remove Element
Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you ...
分类:其他好文   时间:2016-04-11 20:48:21    阅读次数:133
27. Remove Element
Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you ...
分类:其他好文   时间:2016-04-10 00:55:19    阅读次数:224
1961条   上一页 1 ... 75 76 77 78 79 ... 197 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!