学长说现在基本上可以开始学习STL中一些标准模板了,今天先总结一下 队列、栈、优先队列
1、队列(queue)
先进先出原则,头文件#include ,定义结构queue名称;queueq、queueq等;
如:
struct node
{
int x;
}f;
queueq;//结构体类型队列
q.push(f) //将f压入队列的尾部
node t...
分类:
其他好文 时间:
2014-06-28 08:36:49
阅读次数:
162
Problem :It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and ...
分类:
其他好文 时间:
2014-06-28 08:13:17
阅读次数:
249
学习过C语言的同学都知道,再写代码的时候,位操作运算总比算数运算操作快,
本文就是用C语言提供的位运算实现两个数的加法。
本文使用的代码都经过调试正常并且能够运行,调试环境centos gcc 一下是实现代码,以及测试结果:
#include
#include
int main(int argc, char **argv)
{
int add_a,add_b;...
分类:
其他好文 时间:
2014-06-28 07:26:38
阅读次数:
183
Step 1: n ==1 : return 1 n == 2 : return [1,1],[2]Step 2:for n > 2a.arr.push(n)b.arr.push([n-1,1])c.1 get result of recursion(n-2)c.2 combine n==2 & result => retc.3 remove duplicate record in retcod...
分类:
其他好文 时间:
2014-06-28 07:17:11
阅读次数:
255
对于叶子节点和非叶子节点非别列公式。
然后化简公式。
和非树上的差不多。。
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define eps 1e-9
#define zero(x) ((fabs(x)<eps?0:x))
#define maxn 11000
#de...
分类:
其他好文 时间:
2014-06-28 07:15:49
阅读次数:
263
This question is not so difficult.
First,my thoughts were we should use a lot of code to find out the loop block,but there is no need to do that .
you just need to get every new position of char in ...
分类:
其他好文 时间:
2014-06-27 23:39:44
阅读次数:
293
查View的源码可知:
postInvalidate是使用handler发送消息,即可以使用在非UI线程中,而invalidate直接修改布局,所以只能用在UI线程里了。
public void invalidate() {
invalidate(true);
}
void invalidate(boolean invalidateCa...
分类:
其他好文 时间:
2014-06-27 23:39:04
阅读次数:
256
UIImagePickerController *picker = [[UIImagePickerController
alloc]
init];
//资源类型为视频库
NSString *requiredMediaType1 = (
NSString *)kUTTypeMovie;
picker.sourceType =
UIImagePick...
分类:
其他好文 时间:
2014-06-27 23:32:34
阅读次数:
241
作者:无名 邮箱:coolmoonf($#)163.com 博客:http://blog.csdn.net/nnsword
处理目标程序如下:
里面有二个方法,一个加血,一个是减血。由于系统是win7,寻到的Call基址,会改变,所以不能通过固定基址来远程调用这二个方法。所以我们只能变通了。
首先我们知道,编译后程序相对于模块基址的偏移量是不变的,所以我们可以按这个思路来处理。
...
分类:
编程语言 时间:
2014-06-27 23:22:02
阅读次数:
338