码迷,mamicode.com
首页 >  
搜索关键字:in-place    ( 1961个结果
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...
分类:其他好文   时间:2014-07-22 22:53:14    阅读次数:184
【LeetCode with Python】 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?...
分类:编程语言   时间:2014-07-19 23:46:49    阅读次数:516
UVA 10036 Divisibility
Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expr...
分类:其他好文   时间:2014-07-19 22:37:50    阅读次数:243
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-07-19 22:19:36    阅读次数:202
LeetCode——Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / 2 5 / \ 3 4 6 The flattened tree should look like: 1...
分类:其他好文   时间:2014-07-19 11:47:54    阅读次数:168
【leetcode刷题笔记】Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:其他好文   时间:2014-07-19 00:24:36    阅读次数:170
Poj 1144 Zoj 1311 求割点 模板
写这个就是为了手写一份好用的求割点模板: 吐槽下,题目中的 Each of the next at most N lines contains the number of a place followed by the numbers of some places to which there is a direct line from this place.  这个at most是不可信的,应...
分类:其他好文   时间:2014-07-18 11:29:34    阅读次数:232
【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-07-18 00:32:24    阅读次数:271
[leetcode]Set Matrix Zeroes
Set Matrix ZeroesGiven amxnmatrix, 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...
分类:其他好文   时间:2014-07-17 23:34:02    阅读次数:486
【leetcode】Reorder List
Given a singly linked listL: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 exam...
分类:其他好文   时间:2014-07-17 00:23:27    阅读次数:215
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!