注意: 前两个互换的时候,head 要改变位置。还要有一个 pre 指针。注意: 前两个互换的时候,head 要改变位置。还要有一个 pre 指针。思路: 双指针。
分类:
其他好文 时间:
2014-09-09 10:30:28
阅读次数:
292
第一步:添加差分信号线。1、用PADS router打开我们的工程文件,在Project Explorer中选择差分线网络,选中后“Ctrl+C”复制,如下图所示,2、选中“Differential Pairs”,然后“Ctrl + V”粘贴,这样就将一对差分信号线添加到差分网络中,如下图所示第二步...
分类:
其他好文 时间:
2014-09-06 19:57:13
阅读次数:
357
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((...
分类:
其他好文 时间:
2014-09-06 16:05:23
阅读次数:
182
浙大acm,第一题 Calculate a + b Input The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line. Output For each pair of input integers a ...
分类:
编程语言 时间:
2014-09-03 06:16:56
阅读次数:
260
题目链接:uva 12338 - Anti-Rhyme Pairs
题目大意:给定若干个字符串,每次询问两个字符串的最长公共前缀。
解题思路:本来应该将每个字符串连接起来做后缀数组,但其实可以直接把一个字符串看成是一个字符,然后排序了就对应是SA数组,然后处理height即可。然后根据后缀数组的性质,字符串i和j的最长公共前缀长度即为rank[i]+1~rank[j]之间height的...
分类:
其他好文 时间:
2014-09-02 22:54:05
阅读次数:
292
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()",
"()(())", "()()()...
分类:
其他好文 时间:
2014-09-02 10:29:44
阅读次数:
186
Surprising Strings
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 5940
Accepted: 3894
Description
The D-pairs of a string of letters are the ordered pairs...
分类:
其他好文 时间:
2014-09-01 12:34:43
阅读次数:
234
题目:
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only cons...
分类:
其他好文 时间:
2014-08-29 13:13:37
阅读次数:
169
1 /* 2 题意:就是给你一个图,图的每两个点都有多条路径,每一条路径中都有一条最大边, 3 所有最大边的最小边(也就是瓶颈边)就是这两点之间的val值!然后给你一个值f, 4 问有多少个顶点对的val>=f! (u,v) 和 (v, u)是不同的顶点对! 5 6 思路...
分类:
其他好文 时间:
2014-08-29 00:00:26
阅读次数:
301
在android中有五种保存数据的方法,分别是
Shared Preferences
Store private primitive data in key-value pairs.
对应属性的键值对属性文件存储
Internal Storage
Store private data on the device memory.
设备内存存储
External Storage
Store public data on the shared external storage.
外部存储器存储,如内存卡
SQLi...
分类:
移动开发 时间:
2014-08-27 23:31:38
阅读次数:
447