题目链接Problem discriptionGiven two sorted integer
arrays A and B, merge B into A as one sorted array.Note:You may assume that A
has enough space (size t...
分类:
其他好文 时间:
2014-06-16 11:12:36
阅读次数:
192
原题地址:https://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/题意:Follow
up for "Search in Rotated Sorted Array":What ifduplicatesare allowed...
分类:
编程语言 时间:
2014-06-16 08:20:54
阅读次数:
307
Given an array where elements are sorted in
ascending order, convert it to a height balanced BST.递归,二分法。 1 /** 2 *
Definition for binary tree 3 * st.....
分类:
其他好文 时间:
2014-06-16 00:33:31
阅读次数:
252
Given an unsorted integer array, find the first
missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1]
return 2.Your algorithm s...
分类:
其他好文 时间:
2014-06-13 20:25:38
阅读次数:
241
首先需要一个ttf文件的字体。在ios中的方法:把ttf文件放入资源文件下,然后在你的工程的Info.plist文件中新建一行(Add
Row),添加key为:Fonts provided by
application,类型为Array或Dictionary都行;添加Value为XXX.ttf(你字...
分类:
其他好文 时间:
2014-06-13 19:56:52
阅读次数:
428
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-06-13 15:55:47
阅读次数:
273
一、boost库分类:(1)不需要编译库:any、array、asio、conversion、crc、bind/mem_fn、enable_if、function、lambda、mpl、smart_ptr...(2)需要编译的库:date_time、filesystem、function_types...
原先就看过这道题,觉得很复杂。不知道为什么今天一看觉得好水啊……难道这就是并查集的启发式合并?数组d【i】表示i到其父节点的距离,即中间隔了多少船舰。数组sum【i】记录以i为根的集合总共有多少个元素,将新节点插入的时候距离设为sum【i】就好了。代码:
1 var fa,d,sum:array[....
分类:
其他好文 时间:
2014-06-12 09:45:29
阅读次数:
145