码迷,mamicode.com
首页 >  
搜索关键字:spiral matrix    ( 4337个结果
LeetCode: Rotate Image [047]
【题目】 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? 【题意】 给定一个nXn的二维矩阵,按时钟方向旋转90度,不能使用额外的数据结构 【思路】 从外向内逐层旋转...
分类:其他好文   时间:2014-05-26 05:50:25    阅读次数:266
SlipButton——滑动开关
import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; im...
分类:其他好文   时间:2014-05-26 05:49:01    阅读次数:284
LeetCode: Spiral Matrix [058]
【题目】 Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix: [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] You should return [1,2,3,6,9,8,7,4,5]. 【题意】 螺旋输出MxN...
分类:其他好文   时间:2014-05-24 23:11:02    阅读次数:279
young tableaus
Young tableaus  是 Introduction_to_algorithms的一 道课后习题, 一度还把我难住了。现在把 python 代码贴出来,供大家参考。 #! /usr/bin/python """ young tableau    m x n matrix """ import sys class element():     def __ini...
分类:其他好文   时间:2014-05-24 21:08:21    阅读次数:397
51. 顺时针打印矩阵[print matrix in clockwise direction]
print matrix/2d-array in clockwise direction
分类:其他好文   时间:2014-05-24 09:54:29    阅读次数:305
NENU ACM 2014-05-18 A题 && NENU 1081 Lucky
A -LuckyTime Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluSubmitStatusPracticeNENU 1081Description We say a n*m matrix r is lucky if...
分类:其他好文   时间:2014-05-23 09:01:25    阅读次数:304
Leetcode: Search a 2D Matrix
这道题本来思路并不复杂,先对第一列做binary search, 找到target所在的行,再对所在的行做binary search,找到target在或不在。但是我在编程的时候遇到了很多问题,堆栈溢出(StackOverflowError)折腾死我了,一些边界条件的考虑也颇费周折。我之所以会碰到堆...
分类:其他好文   时间:2014-05-23 08:35:31    阅读次数:294
Leetcode: Set Matrix Zeroes
一次过,空间复杂度为O(m+n), 下一次做的时候寻找constant space solution。用boolean array也可以,用bit vector可能会更节省 1 import java.util.*; 2 3 public class Solution { 4 public...
分类:其他好文   时间:2014-05-23 08:30:28    阅读次数:278
Matlab编程基础
原文:Matlab编程基础平台:Win7 64 bit,Matlab R2014a(8.3) “Matlab”是“Matrix Laboratory” 的缩写,中文“矩阵实验室”,是强大的数学工具。本文侧重于Matlab的编程语言侧面,讲述Matlab的基本语法,以及用Matlab语言进行程序设计。...
分类:其他好文   时间:2014-05-22 00:17:34    阅读次数:642
POJ【数论/组合/博弈论】
POJ【数论/组合/博弈论】题目列表 POJ【数论/组合/博弈论】题目列表 原来的列表比较水,今天换了一个难一些的列表,重新开始做~ 红色的代表已经AC过,蓝色的代表做了但是还没过。这句话貌似在我空间里的每份列表里都有额。 博弈论 POJ 2234 Matches Game POJ 2975 Nim POJ 2505 A multiplication game POJ...
分类:其他好文   时间:2014-05-21 11:09:40    阅读次数:346
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!