自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 资源 (12)
  • 收藏
  • 关注

原创 300. Longest Increasing Subsequence

Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7, 101], ther

2016-08-23 17:59:27 280

原创 Leetcode 343(Integer Break非动态规划求解)

问题 Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get. For example, given n = 2,

2016-04-20 10:27:52 613

原创 Leetcode 137: (Single Number II)

Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without us

2016-04-13 20:20:20 330

原创 Leetcode 142: Linked List Cycle II & Leetcode 287: Find the Duplicate Number

Leetcode 142: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. 解题思路:设置两个指针,一个快(fp), 一个慢(sp)。fp每次走两步,速度是2v2v,sp每

2016-04-13 13:48:55 289

原创 Leetcode 264(Ugly Number II)

QuestionWrite a program to find the nthn^{th} ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the

2015-08-19 13:31:36 792

原创 LeetCode 190(Reverse Bits)

QuestionReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 001110

2015-08-18 10:51:01 661

原创 Leetcode201(Bitwise AND of Numbers Range)

QuestionGiven a range [m,n][m, n] where 0<=m<=n<=21474836470 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.For example, given the range [5,7][5, 7], you should

2015-08-16 23:44:26 376

原创 LeetCode 119(Pascal's Triangle II)

QuestionGiven an index k, return the kthk^{th} row of the Pascal’s triangle.For example, given k=3k = 3,Note:Could you optimize your algorithm to use only O(k) extra space?Analysis帕斯卡三角,也就是传说中的杨辉三角。其形状

2015-08-05 22:16:14 315

原创 Leetcode 134(Gas Station)

QuestionThere are N gas stations along a circular route, where the amount of gas at station ii is gas[i]gas[i].

2015-07-29 12:54:32 400

原创 Leetcode135(Candy)

Question原文引自> https://leetcode.com/problems/candy/There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requ

2015-07-28 22:30:59 401

原创 Leetcode 64(Minimum Path Sum)

Question:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or righ

2015-07-26 11:09:11 319

原创 LeetCode75(Sort Color)

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.

2015-07-21 23:14:36 391

原创 求解twitter面试题(墙壁装水问题)

看见twitter上一道面试题,题目是这样的,试着做了一下 “在这个图片里我们有不同高度的墙。这个图片由一个整数数组所代表,数组中每个数是墙的高度。上边的图可以表示为数组[2,5,1,2,3,4,7,7,6]” “假如开始下雨了,那么墙之间的水坑能够装多少水呢?” 思路分析: 1.     找出该数组最大的元素(row); 2.     将该数组以该最

2015-02-04 15:07:02 1075

原创 Dijkstra 算法示例

以上图作为示例,选取u为源点,然后计算u到其他顶点的最短距离。 先假设dist[i]为u到i的最短路径的长度。\ cost[x,y]表示x到y的权值。 ①找出与u相邻的顶点中距离最短的一条,得:dist[X]=1; ②和u或者x的最短路径为cost[x,y]=1,所以dist[y]=cost(u,x)+cost(x,y)=2; ③下个结点是w,dist[w]=min{cost(u,w),

2011-11-20 11:52:28 418

原创 关于robocode一些小感悟

<br />     第一次认识robocode是在java课的课程设计上。第一次接触它,就深深的被他吸引住了,并由此开始了robocode的学习历程。<br />     作为一个普通学生,对robocode的理解当然不能同研究robocode的众多专业人士相比较,所以自在这发表一些自己的粗浅言论,万望大家批评指教。<br />    首先,可以毫无疑问的说robocode是一个及其好的学习java的工具。有很多人沉迷于QQ农场的一个重要原因就是因为其简单,易操作,更重要的是她和好友是互动的。roboco

2011-04-30 19:47:00 501

java语言数据挖掘baysian算法。

用java语言开发的简短的baysian算法,条理清晰,不需修改便可直接运行。

2012-07-01

Android基础教程

你的第一本Android书   Pragmatic系列图书品质保证   从这里,开始一个新的梦想   “跟本书的2005版一样,我认为Louis的这本书写得非常好,信息量极其丰富而且实践性强。阅读过程中,你会觉得是在跟作者讨论问题。我喜欢这本书,还因为它有自己的观点,而非从在线图书中照搬过来……”           —— Amazon读者评论   这本书极其出色,不仅文笔流畅、浅显易懂,内容也妙趣横生。本书既恰到好处地讲解了Android独有的特性,同时也突出了高质量编程的原则。           ——Anthony Stevens Pocket Journey创始人兼CTO,Google Android竞赛前20强   Ed Burnette的这本书虽然篇幅不长,但内容丰富,保持了Pragmatic(实用)系列图书的一贯风格。仅凭2D和3D图形方面的内容,本书就非常值得所有Android开发人员拥有。           ——Mark Murphy Commons Ware创始人   我还记得第一次使用Android时的情景:当时感觉它就像是一座超大型迷宫。有了这本书,入门就不会那么痛苦了。我深信,通过阅读本书,上手开发Android应用程序将是一件非常轻松愉快的事。            ——Gabor Paller On Relay公司高级软件架构师

2011-12-09

面向对象技术UML教程

老师推荐的UML读物。重庆大学UML课程的配套教材。学习UML很好的工具。

2011-09-15

Windows Forms

Windows Forms简介,包含Windows Forms的基础知识。

2011-05-01

严蔚敏:数据结构(C语言版).

严蔚敏:数据结构(C语言版).清华大学老师所写,经典,学数据结构必看。

2011-04-25

《C++编程思想(Thinking in C++)》

<<Thingking in C++>>绝对的C++经典图书,不看会后悔的。

2011-04-25

多媒体数据库与网络应用

《多媒体数据库与网络应用》,老师推荐的数据库参考书,没事时看看,应该会有收获。

2011-04-24

萨王数据库系统概论第三版

《萨王数据库系统概论》第三版数据库经典书籍,老师推荐的。看了一下,还不错,推荐给大家。

2011-04-24

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除