一、动态栈的实现#include #include #include //定义一个节点的结构typedef struct node{ int member; //数据域 struct node *pNext; ...
分类:
编程语言 时间:
2014-07-16 22:54:30
阅读次数:
266
poj1753 Flip Game(枚举Enum+dfs)...
分类:
其他好文 时间:
2014-07-11 00:57:41
阅读次数:
251
经验:避免返回handles(包括 references、指针、迭代器)指向对象内部。遵守这个条款可增加封装性,
帮助 const 成员函数的行为像个 const,并将发生“虚吊号码牌”(dangling handles)的可能性降至最低。
示例:
class Point{
public:
Point(int x, int y);
//...
void setX(int newVal);
void setY(int newVal);
//...
};
struct RectData{
Point...
分类:
编程语言 时间:
2014-07-10 22:56:05
阅读次数:
230
题目大意:
n波人去k*k的电影院看电影。
要尽量往中间坐,往前坐。
直接枚举,贪心,能坐就坐,坐在离中心最近的地方。
#include
#include
#include
#include
#define maxn 1000005
#define lowbit(x) (x&(-x))
using namespace std;
struct BI...
分类:
其他好文 时间:
2014-07-10 22:52:57
阅读次数:
262
Objective-C中常用的结构体NSRange,NSPoint,NSSize(CGSize),NSRect
1 NSRange
NSRange 的原型为
typedef struct _NSRange {
NSUInteger location;
NSUInteger length;
} NSRange;
NSMakeRange的函数...
分类:
其他好文 时间:
2014-07-10 21:52:57
阅读次数:
217
POJ2965 The Pilots Brothers' refrigerator(直接计算或枚举Enum+dfs)...
分类:
其他好文 时间:
2014-07-10 21:18:20
阅读次数:
188
新单词unidirectional get T T
求有向图上,以某点为根的,最小生成树
参考别人的模板
#include
#include
#include
#include
#include
#include
#include
#define inf 2000000000
using namespace std;
struct node1
{
double x,...
分类:
Web程序 时间:
2014-07-10 20:32:47
阅读次数:
285
引言:
队列与栈的区别是队列是先进先出的数据结构。为了使得出入队列容易,可以引入队列头指针和队列尾指针。
分析描述:
队列的结点结构。
typedef int QElemType;
typedef struct QNode{
QElemType data;
struct QNode *next;
}QNode, *QueuePtr;...
分类:
其他好文 时间:
2014-07-10 19:28:47
阅读次数:
197
在开发java程序的过程中,我们遇到了条件判断首选就是switch,但是java中的switch功能不支持字符串作为条件。这时我们该怎么办呢? ——使用枚举。
一、枚举简单了解
1、enum是一种数据类型。
特殊:是指在枚举中将变量的值一一列出来,变量的值只限于列举出来的值的范围内。
特殊到一般化:enmu 就是我们根据自己业务需要定义的同“String,int”相同的数据类...
分类:
编程语言 时间:
2014-07-10 17:36:47
阅读次数:
224
点击打开链接
简单
模拟机器人的移动,发生碰撞时输出相应的信息。
code
#include
#include
using namespace std;
struct node{
int k;
int s;
}
mtx[200][200];
struct node1{
int x, y;
}
rob[200];
int n, m;
int...
分类:
其他好文 时间:
2014-07-10 17:25:11
阅读次数:
153