码迷,mamicode.com
首页 >  
搜索关键字:in-place    ( 1961个结果
leetcode第25题--Remove Element
problem: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 doe...
分类:其他好文   时间:2014-10-20 19:20:57    阅读次数:241
swift基本用法-for循环遍历,遍历字典,循环生成数组
// Playground - noun: a place where people can play import UIKit //------------------------------------------------------------------------------ // 1. for // 传统的for循环方式在swift中同样支持 var num = 0 for(v...
分类:编程语言   时间:2014-10-20 15:14:51    阅读次数:221
Flatten Binary Tree to Linked List
[leetcode]Given a binary tree, flatten it to a linked list in-place....
分类:其他好文   时间:2014-10-17 12:03:13    阅读次数:119
Sicily 1172. Queens, Knights and Pawns
ConstraintsTime Limit: 1 secs, Memory Limit: 64 MBDescriptionYou all are familiar with the famous 8-queens problem which asks you to place 8 queens on...
分类:其他好文   时间:2014-10-17 02:53:23    阅读次数:417
leetcode - 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. class Solution { public: void setZeroes(std::vector > &matrix) { int m = matrix.size(); ...
分类:其他好文   时间:2014-10-13 18:45:17    阅读次数:190
2014牡丹江区域赛B(树的直径)ZOJ3820
Building Fire Stations Time Limit: 5 Seconds      Memory Limit: 131072 KB      Special Judge Marjar University is a beautiful and peaceful place. There are N buildings and N - 1 bidirectional ro...
分类:其他好文   时间:2014-10-13 12:21:25    阅读次数:123
Splitting Linked List
This is a very good linked list question, as there are tricky cases you have to consider, and getting them all right in one place is harder than it lo...
分类:其他好文   时间:2014-10-12 05:54:07    阅读次数:161
UVA11080- Place the Guards(二分图染色)
题目链接 题意:放最少的士兵去监视所有的道路, 但士兵不可相邻,符合的话,就输出最少的士兵数,否则输出-1 思路:其实就是二分图染色,即黑白染色,然后选择黑白染色最少的那个颜色累加,但要注意可能有多个连通块,只要有一个连通块不符合的话,就不符合。 代码: #include #include #include #include #include using...
分类:其他好文   时间:2014-10-11 22:37:06    阅读次数:297
leetcode dfs Flatten Binary Tree to Linked List
Flatten Binary Tree to Linked List  Total Accepted: 25034 Total Submissions: 88947My Submissions Given a binary tree, flatten it to a linked list in-place. For example, Given 1...
分类:其他好文   时间:2014-10-11 20:54:36    阅读次数:214
第18题 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 matter what you leave beyond the new length. S...
分类:其他好文   时间:2014-10-11 18:55:56    阅读次数:185
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!