棋子

导航

08 2015 档案

Convert Sorted List to Balanced Binary Search Tree leetcode
摘要:题目:将非递减有序的链表转化为平衡二叉查找树!参考的博客:http://blog.csdn.net/worldwindjp/article/details/39722643利用递归思想:首先找到链表的中间节点,于是链表被分为了由该中间节点划分开来的两部分。递归地处理这两部分,最终便得到了平衡二叉查找... 阅读全文

posted @ 2015-08-31 00:11 鼬与轮回 阅读(262) 评论(1) 推荐(0) 编辑

中位数II
摘要:该题目与思路分析来自九章算法的文章,仅仅是自己做个笔记!题目:数字是不断进入数组的,在每次添加一个新的数进入数组的同时返回当前新数组的中位数。解答:这道题是用堆解决的问题。用两个堆,max heap和min heap,再加一个median值,维持两个堆的大小相等(小根堆可以比大根堆多一个)。对于新来... 阅读全文

posted @ 2015-08-26 14:29 鼬与轮回 阅读(265) 评论(0) 推荐(0) 编辑

largest rectangle in histogram leetcode
摘要:Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histog... 阅读全文

posted @ 2015-08-22 20:05 鼬与轮回 阅读(197) 评论(0) 推荐(0) 编辑

文摘
摘要:只有知道如何停止的人才知道如何加快速度。生活中没有绝境,绝境在于你自己的心没有打开。任何伟大的东西,你分到日常的每一天去,都是很小的事情。当你是地平线上一棵草的时候,不要指望别人会在远处看到你,即使他们从你身边走过甚至从你身上踩过,也没有办法,因为你只是一棵草;而如果你变成了一棵树,即使在很远的地方... 阅读全文

posted @ 2015-08-22 12:49 鼬与轮回 阅读(158) 评论(0) 推荐(0) 编辑

Maximal Square leetcode
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matr... 阅读全文

posted @ 2015-08-21 23:52 鼬与轮回 阅读(177) 评论(0) 推荐(0) 编辑

Majority Element II
摘要:Given an integer array of sizen, find all elements that appear more than⌊ n/3 ⌋times. The algorithm should run in linear time and in O(1) space.网络上的思路... 阅读全文

posted @ 2015-08-20 15:01 鼬与轮回 阅读(185) 评论(0) 推荐(0) 编辑

Merge k Sorted Lists leetcode
摘要:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Hide TagsDivide and ConquerLinked ListHeapHide Similar... 阅读全文

posted @ 2015-08-19 23:57 鼬与轮回 阅读(197) 评论(0) 推荐(0) 编辑

学习方法-暗时间
摘要:根据主题来查阅资料,而不是根据资料来查阅主题 。以前读书的时候是一本一本的读,眼里看到的是一本一本的书, 现在则是一章、 甚至一节一节的读, 眼中看到的不是一本一本的书, 而是一堆一堆的章节, 一个一个的知识主题, 按照主题来阅读, 你会发现读的时候不再是老老实实地一本书看完看另一本, 而是非常频繁... 阅读全文

posted @ 2015-08-18 09:02 鼬与轮回 阅读(187) 评论(2) 推荐(0) 编辑

4sum leetcode
摘要:Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ... 阅读全文

posted @ 2015-08-17 00:35 鼬与轮回 阅读(181) 评论(0) 推荐(0) 编辑

valid parentheses
摘要:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文

posted @ 2015-08-16 01:28 鼬与轮回 阅读(194) 评论(0) 推荐(0) 编辑

两道考研算法设计题- 2010 2013
摘要:2010:设将n(n>1)个整数存放到一维数组R中。试设计一个在时间和空间两方面都尽可能高效的算法,将R中保存的序列循环左移P(0 2 #include 3 usingnamespacestd; 4 5 voidreverse(inta[],intbegin,intend) 6 { 7 i... 阅读全文

posted @ 2015-08-15 15:38 鼬与轮回 阅读(806) 评论(1) 推荐(0) 编辑

regular expression matching DP
摘要:这个题目,我从前天晚上(8月6号晚上)调试到现在(8月8号16:21),太心酸了,不好好总结一下,就太对不起自己了!这是题目:Implement regular expression matching with support for'.'and'*'.'.' Matches any single ... 阅读全文

posted @ 2015-08-08 17:13 鼬与轮回 阅读(202) 评论(0) 推荐(0) 编辑

valid sudoku leetcode
摘要:该题:判断一个9行9列的数独是否合法,并不是判断数独是否有解。也就是只要判断每一行,每一列,每一个子九宫格是否有重复数字,若有,则不合法。 最简单的方法,当然是使用3个二维数组,并使用3个二重循环来进行判断。 不过我们可以稍加改进,一个二重循环即可以解决。关键在于行,列,子九宫格是如何看待这两个... 阅读全文

posted @ 2015-08-06 14:53 鼬与轮回 阅读(133) 评论(0) 推荐(0) 编辑

regular expression matching leetcode
摘要:Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The... 阅读全文

posted @ 2015-08-06 11:54 鼬与轮回 阅读(184) 评论(0) 推荐(0) 编辑

Add two numbers leetcode
摘要:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文

posted @ 2015-08-05 00:13 鼬与轮回 阅读(265) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示