码迷,mamicode.com
首页 >  
搜索关键字:in-place    ( 1961个结果
[LeetCode] Set Matrix Zeroes
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. click to show follow up. Follow up: Did you use extra space? A straight for...
分类:其他好文   时间:2015-07-29 17:16:51    阅读次数:112
LeetCode-- Flatten Binary Tree to Linked List
Flatten Binary Tree to Linked List Given a binary tree, flatten it to a linked list in-place.For example, 1 / 2 5 / \ 3 4 6 这个道题方法有多种,虽然下面这个很简单,但我觉得还是蛮经典。...
分类:其他好文   时间:2015-07-29 17:12:23    阅读次数:141
find zhe median
题目描述: Median?Value The?Median?is?the?"middle"?of?a?sorted?list?of?numbers. How?to?Find?the?Median?Value To?find?the?Median,?place?the?numbers?in?value?order?and?f...
分类:其他好文   时间:2015-07-29 16:02:42    阅读次数:180
ZOJ 1654 Place the Robots(最大匹配)
Robert is a famous engineer. One day he was given a task by his boss. The background of the task was the following: Given a map consisting of square blocks. There were three kinds of blocks: Wall,...
分类:其他好文   时间:2015-07-29 12:21:07    阅读次数:147
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...
分类:其他好文   时间:2015-07-28 18:27:00    阅读次数:82
leetCode 92.Reverse Linked List II (反转链表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 t...
分类:其他好文   时间:2015-07-27 11:11:00    阅读次数:113
Set Matrix Zeros
问题描述Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.解决思路难点在于如何不使用辅助空间。一个巧妙的想法是,1. 使用两个标记变量,row0_has_zeros和col...
分类:其他好文   时间:2015-07-25 12:01:16    阅读次数:139
【LeetCode-面试算法经典-Java实现】【027-Remove Element(删除数组中指定的元素)】
【027-Remove Element(删除数组中的元素)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题  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 ch...
分类:编程语言   时间:2015-07-25 09:33:10    阅读次数:165
LeetCode#27 Remove Element
Problem Definition: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 chan...
分类:其他好文   时间:2015-07-24 22:29:06    阅读次数:148
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...
分类:其他好文   时间:2015-07-24 09:16:36    阅读次数:117
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!