摘要: #includeusing namespace std;struct Point { int x, y; Point(int x=0, int y=0):x(x),y(y) {}};int main() { Point p1, p2; swap(p1, p2); return 0;} 1 ... 阅读全文
posted @ 2015-03-14 01:48 Geekers 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 //结点的结构体 6 //内涵三个参数,关键字Key,左孩子指针,右孩子指针 7 typedef struct _NODE_ 8 { 9 int Key; 10 _NODE_* pLeft; 11 _NODE_* pRight; 12 }Node,*pNode; 13 14 //中序遍历 15 void InOrderTraves(pNode T); 16 17 18 //层状遍历 19 void LevelTraves(pNode T); ... 阅读全文
posted @ 2014-01-05 13:12 Geekers 阅读(3323) 评论(0) 推荐(0) 编辑
摘要: /* * Author: BigBallon * Note: Max_priority_queue * Date: 2013.11.21 */一篇好文章:http://blog.csdn.net/xihuanqiqi/article/details/7098909#includeusing namespace std;void My_swap(int& x, int& y){ int t = x; x = y; y = t;}void Max_Heapify(int* A, int i, int len){ int lt = i A[i]) l... 阅读全文
posted @ 2013-11-22 00:00 Geekers 阅读(328) 评论(0) 推荐(0) 编辑
摘要: /****************************************Vector总结*vector模塑出一个动态数组,因此,它本身是“将元素至于动态数组中加以管理”*的一个抽象的概念。**1.使用前需要包含头文件*2.Vector将其元素复制到内部的dynamic array中。 元素之间总是存在某种顺序,所以vector是一种有序群集(ordered collec)。 vector支持随机存取,因此只要知道位置,你可以在常数时间内存取任何一个元素。 vector的迭代器是随机存取迭代器,所以对任何一个STL算法都可以奏效。*个人理解:vector是在末端插入 或者... 阅读全文
posted @ 2013-11-19 21:15 Geekers 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 4497http://fudq.blog.163.com/blog/static/19135023820137294929320/http://www.cnblogs.com/liuxueyang/archive/2013/08/26/3281680.htmlhttp://tech.ddvip.com/2013-11/1383560842205344.html 阅读全文
posted @ 2013-11-10 21:02 Geekers 阅读(253) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;void main(){//与静态库相关联 HMODULE hDll = LoadLibrary("HookAPIDll.dll"); printf("被钩掉的那个API,MessageBox,现在变成了打开calc.exe\n"); printf("你现在看的是一个计算器,对不对,哈哈!\n"); //第一个MessageBox MessageBox(NULL,"这是第一个MessageBox","Test",0); 阅读全文
posted @ 2013-11-07 21:49 Geekers 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 1 //基本线性队列 2 #include 3 4 using namespace std; 5 6 typedef struct _NODE_ 7 { 8 9 int a; 10 _NODE_* pNext; 11 }Node,*pNode; 12 13 14 class CQueue 15 { 16 private: 17 pNode m_pTop; 18 pNode m_pBase; 19 int iNodeCount; 20 21 22 public: 23 CQueue() 24 { 25 2... 阅读全文
posted @ 2013-11-05 19:53 Geekers 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 先放着,待会再来http://blog.chinaunix.net/uid-22609852-id-3506122.htmlhttp://proverbs.diandian.com/post/2012-05-11/19248470http://www.cppblog.com/Yusi-Xiao/archive/2009/03/21/77383.htmlhttp://www.cnblogs.com/HappyAngel/archive/2010/05/12/1734108.htmlhttp://www.lvzejun.cn/?p=332//题目//记得今天写出解体报告 阅读全文
posted @ 2013-11-05 13:08 Geekers 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1、malloc与free是C++/C语言的内存分配标准库函数,属于stdlib库;new/delete是C++的操作运算符。它们都可用于申请动态内存和释放内存。 2、 对于非内部数据类型的对象而言,光用maloc/free无法满足动态对象的要求。对象在创建的同时要自动执行构造函数,对象在消亡之前要自动执行析构函数。由于malloc/free是库函数而不是运算符,不在编译器控制权限之内,不能够把执行构造函数和析构函数的任务强加于malloc/free。 3、C++语言需要一个能完成动态内存分配和初始化工作的运算符new,以及一个能完成清理与释放内存工作的运算符delete。注意new/del. 阅读全文
posted @ 2013-11-02 20:29 Geekers 阅读(560) 评论(0) 推荐(0) 编辑
摘要: //链表的头插法/***************************************///运用了OFFSET的宏定义 //通过GetNextPtr来实现OFFSET偏移//最终实现链表结点的头插法。//麻省算法导论/***************************************/#include#includeusing namespace std;#define OFFSET(x,m) (unsigned long)(&((x*)0)->m)/****************结点*****************/typedef struct _NO 阅读全文
posted @ 2013-11-02 20:23 Geekers 阅读(438) 评论(0) 推荐(0) 编辑