1. 查找和排序查找:顺序查找、二分查找、二叉搜索树、哈希表顺序查找:T(n) = O(n)
std::find二分查找:T(n) = O(log n) std::binary_search std::lower_bound
std::upper_bound哈希表: T(n) = O...
分类:
其他好文 时间:
2014-06-11 07:45:31
阅读次数:
250
这个题之前做过,方法太笨还不对,今天再做突然想到一个巧妙做法,网上应该也有别人用此方法的,因为并不是很难,但我没有看别人的,是自己想出来的哈哈哈
首先要对输入的数组进行排序,这是毋庸置疑的。
因为要计算绝对值的和,所以就想到了数轴上的距离的概念。要使|X1-A|+|X2-A|最小,也就是要找一个点A,使其到X1,X2距离和最短,所以很容易想到在数轴上只要A在X1和X2之间就行。...
分类:
其他好文 时间:
2014-06-08 15:20:36
阅读次数:
202
ASP.NET Barcode Web Server Control
是一款自定义服务器控件,被设计用于ASP.NET Web应用程序中。它可与Microsoft Visual
Studio及其他的.NET开发环境兼容。所有类似的条码符号编码规格都是合并成单一的,小的,全功能的,可再发布的文件,不需...
分类:
Web程序 时间:
2014-06-05 21:45:03
阅读次数:
345
Given an array of strings, return all groups of
strings that are anagrams.Note: All inputs will be in
lower-case.classSolution{public:vectoranagrams(v...
分类:
其他好文 时间:
2014-06-04 19:29:39
阅读次数:
247
今天看了鸟哥的linux私房菜,关于正则表达式:简单做笔记如下:
[:upper:] 大写字母 A-Z
[:lower:] 小写字母 a-z
[:digit:] 数字 0-9
[:alpha:] 字母 A-Z a-z
[:alnum:] 字母和数字 A-Z a-z 0-9
首先介绍几个字符:
^ 表示行首 (^在方括号[ ]内表示不包含,在[ ]外表示行首!!!)...
分类:
其他好文 时间:
2014-06-02 22:29:06
阅读次数:
238
一、字符函数字符函数是oracle中最常用的函数,我们来看看有哪些字符函数:lower(char):将字符串转化为小写的格式。upper(char):将字符串转化为大写的格式。length(char):返回字符串的长度。substr(char,
m, n):截取字符串的子串,n代表取n个字符的意思,...
分类:
数据库 时间:
2014-05-29 21:54:37
阅读次数:
428
The most known area of theJordan 6 Carminemay
be the two-finger pull-up tongue and also the button lower shroud that hides top
of the a part of its la...
分类:
其他好文 时间:
2014-05-26 21:03:46
阅读次数:
333
【题目】
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is defined as a character sequence consists of non-space ...
分类:
其他好文 时间:
2014-05-25 07:39:05
阅读次数:
256
【题目】
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
For example:
Input: ["tea","and","ate","eat","den"]
Output: ["tea","ate","eat"]
【题意】
anagrams指的是颠倒字母顺序构成的单词,以tea为例,则与它an...
分类:
其他好文 时间:
2014-05-24 18:36:01
阅读次数:
317
1. 设置ATU 区域号寄存器为需要配置的地址转换区编号。
2. 设置ATU Region Lower Base Address Register 和ATU Region Upper Base Address
Register。(在此区域内的目标地址将由区域号寄存器所在的ATU 转换)
3. 设置ATU Region Limit Address Register。
4. 设置ATU Reg...
分类:
其他好文 时间:
2014-05-21 13:52:28
阅读次数:
247