上一页 1 2 3 4 5 6 ··· 16 下一页
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the... 阅读全文
posted @ 2014-10-12 14:54 Avril 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 参考:http://xudacheng06.blog.163.com/blog/static/4894143320127891610158/杨氏矩阵(Young Tableau)是一个很奇妙的数据结构,他类似于堆的结构,又类似于BST的结构,对于查找某些元素,它优于堆;对于插入、删除它比BST更方便... 阅读全文
posted @ 2013-09-01 14:39 Avril 阅读(4358) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.cppblog.com/wicbnu/archive/2013/03/18/198565.html我太喜欢用dfs和回溯法了,但是这些暴力的方法加上剪枝之后复杂度依然是很高,显然不能达到题目的要求。这个时候应该考虑动态规划,并且要复杂度尽量接近O(n^2)的算法。下面这个... 阅读全文
posted @ 2013-08-31 20:15 Avril 阅读(3338) 评论(1) 推荐(0) 编辑
摘要: Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounded region... 阅读全文
posted @ 2013-08-30 19:15 Avril 阅读(1844) 评论(0) 推荐(0) 编辑
摘要: 1.10 双线程高效下载伪码给出了典型的生产者消费者问题解答,用一个信号量(semaphore)表示剩余空闲块数(g_seEmpty),一个信号量表示已下载记录数(g_seFull)。下载线程中消耗空闲块,所以先g_seEmpty.Unsignal(),相当于P(g_seEmpty),完成后g_se... 阅读全文
posted @ 2013-08-30 11:19 Avril 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 据传说是MS/Google等等IT名企业的面试题:有一组数字,从1到n,中减少了一个数,顺序也被打乱,放在一个n-1的数组里请找出丢失的数字,最好能有程序,最好算法比较快BTW1: 有很多种方法的哦,据说O(n)的方法就不止一种BTW2: 扩展问题,如果丢失了2个数字呢?BTW3: 一定要小心不要溢... 阅读全文
posted @ 2013-08-29 10:22 Avril 阅读(1563) 评论(1) 推荐(1) 编辑
摘要: >>最近了解了一些题目,其中对棋盘或者是汉诺塔的表示一般都用到了状态压缩的方法,配合BFS或者是DP来做。题目链接:汉诺塔移动http://stackoverflow.com/questions/16601701/facebook-sample-puzzle-towers-of-hanoi黑白棋游戏... 阅读全文
posted @ 2013-08-26 12:12 Avril 阅读(9398) 评论(0) 推荐(0) 编辑
摘要: 题目:给出n个互不相同的字符, 并给定它们的相对大小顺序,这样n个字符的所有排列也会有一个顺序.现在任给一个排列,求出在它后面的第i个排列.这是一个典型的康拓展开应用,首先我们先阐述一下什么是康拓展开。(1)康拓展开 所谓康拓展开是指把一个整数X展开成如下形式: X=a[n]*(n-1)!+a[... 阅读全文
posted @ 2013-08-26 12:04 Avril 阅读(405) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/abcbc/article/details/8943485具体的题目描述为:Givennnon-negative integers representing the histogram's bar height where the width of each... 阅读全文
posted @ 2013-08-24 01:21 Avril 阅读(8522) 评论(3) 推荐(1) 编辑
摘要: 英文原文:http://corner.squareup.com/2013/07/reversing-bits-on-arm.html本文讲解翻转bit位的一些方法,例如如何将1001 1101变为1011 1001.另参考:http://www.cnblogs.com/xueda120/p/3151... 阅读全文
posted @ 2013-08-13 21:14 Avril 阅读(278) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 16 下一页