码迷,mamicode.com
首页 >  
搜索关键字:in-place    ( 1961个结果
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 fo...
分类:其他好文   时间:2014-07-03 20:58:08    阅读次数:248
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-03 20:32:55    阅读次数:429
[leetcode] Reverse Linked List II
Reverse a linked list from position m to n. Do it in-place and in one-pass.
分类:其他好文   时间:2014-07-02 20:12:57    阅读次数:182
HTML5 Placeholder实现input背景文字提示效果
这篇文章我们来看看什么是input输入框背景文字提示效果,如下图所示:这种效果现在网上非常的普遍流行,但大部分是使用JavaScript实现的。但HTML5给我们提供了新的纯HTML的实现方式,不需要任何的JavaScript,只需要在你的input文本框的标记上添加HTML5规范里新增的place...
分类:Web程序   时间:2014-07-02 18:44:52    阅读次数:245
Reorder List
题目 Given a singly linked list L: 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 example, Given {1,2,3,4}, re...
分类:其他好文   时间:2014-07-01 08:39:24    阅读次数:181
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 lik...
分类:其他好文   时间:2014-07-01 08:03:10    阅读次数:127
hdu 1690 Bus System(最短路)
问题:         链接:点击打开链接 题意: 思路: 代码: #include #include #include using namespace std; #define INF 1000000000000 typedef __int64 LL; const int N = 110; __int64 dis[N][N],place[N]; __int64 L1,L2,L...
分类:其他好文   时间:2014-07-01 07:16:25    阅读次数:248
python实现插入排序
一般来说,插入排序都采用in-place在数组上实现。具体算法描述如下: 从第一个元素开始,该元素可以认为已经被排序取出下一个元素,在已经排序的元素序列中从后向前扫描如果该元素(已排序)大于新元素,将该元素移到下一位置重复步骤3,直到找到已排序的元素小于或者等于新元素的位置将新元素插入到该位置后重复步骤2~5 #! /usr/bin/env python # -*- coding: ut...
分类:编程语言   时间:2014-07-01 06:58:27    阅读次数:255
每日算法之三十七: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? 原地图像顺时针旋转90度。因为要求空间复杂度是常数,因此应该迭代旋转操作。 class ...
分类:其他好文   时间:2014-06-30 19:51:53    阅读次数:267
LeetCode——Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with...
分类:其他好文   时间:2014-06-30 17:22:13    阅读次数:196
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!