Find Minimum in Rotated Sorted Array II Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-...
分类:
其他好文 时间:
2014-10-24 20:42:30
阅读次数:
299
这道题跟Pascal's Triangle很类似,只是这里只需要求出某一行的结果。...
分类:
其他好文 时间:
2014-10-24 19:01:21
阅读次数:
233
UVA10869 - Brownie Points II(线段树)
题目链接
题目大意:平面上有n个点,Stan和Ollie在玩游戏,游戏规则是:Stan先画一条竖直的线作为y轴,条件是必须要经过这个平面上的某一点,而ollie则画x轴,但是要在Stany画的y轴上经过的点中任意选择一点来作为原点画x轴。然后这个平面就被划分为4个象限,轴上的点都不算,1,3象限的点的个数就是Stan的...
分类:
其他好文 时间:
2014-10-24 16:39:47
阅读次数:
219
今早起来做 LeetCode,结果被这道题卡了将近1个半小时,忍着没有去搜答案,最后还是被我想出来了,而且直接一次AC,哈哈!现在在这里记录一下解题思路。原题:Givenn, generate all structurally uniqueBST's(binary search trees) t.....
分类:
其他好文 时间:
2014-10-24 15:57:21
阅读次数:
202
给定一个链表,如果链表中有环则返回环的开始节点,否则返回NULL。要求不用额外的空间完成。...
分类:
其他好文 时间:
2014-10-24 13:01:28
阅读次数:
159
Given a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such possibl...
分类:
其他好文 时间:
2014-10-24 12:38:28
阅读次数:
261
Spiral Matrix IIGiven an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should retu...
分类:
其他好文 时间:
2014-10-24 12:35:31
阅读次数:
259
https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/允许重复,也就意味着会有a[l]==a[r],以及a[mid]==a[r]的情况出现。后者比较好办,从坐标图中看出直接r=mid即可。前者会有一个问题是当...
分类:
编程语言 时间:
2014-10-24 12:20:09
阅读次数:
197
记录此方法,为方便以后写论文用。打开signaltap II 后,打开菜单中的File——Export——“export formal”里选择jpg格式——OK——选择“maintain spacing-only data in current view will be exported”,这样的画...
原题地址:https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/解题思路:这道题和上一道题的区别是,数组中可能有相同的数。那么,分下列几种情况:代码:class Solution: # @param n...
分类:
编程语言 时间:
2014-10-23 16:07:04
阅读次数:
183