码迷,mamicode.com
首页 >  
搜索关键字:struct    ( 18973个结果
优先队列
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; struct node{ char...
分类:其他好文   时间:2014-08-03 10:20:25    阅读次数:216
poj 1456 Supermarket (贪心+并查集)
# include # include # include using namespace std; int fa[10010]; struct node { int p; int d; }; struct node a[10010]; bool cmp(node a1,node a2)//利润从大到小 { return a1.p>a2.p; } int find(int x) {...
分类:其他好文   时间:2014-08-03 10:16:25    阅读次数:208
Populating Next Right Pointers in Each Node
问题:将二叉树的所有结点指向他的右边的一个结点分析:对于每一个结点来说,其操作都是一样的,除了他的左儿子指向右儿子外,其左儿子的全部右后辈均指向其右儿子的全部左后辈/** * Definition for binary tree with next pointer. * struct TreeLin...
分类:其他好文   时间:2014-08-03 10:12:05    阅读次数:178
Go 方法和接口
方法Go 没有类。然而,仍然可以在结构体类型上定义方法。方法接收者出现在func关键字和方法名之间的参数中。package mainimport ( "fmt" "math")type Vertex struct { X, Y float64}func (v *Vertex) Abs() float...
分类:其他好文   时间:2014-08-03 07:49:14    阅读次数:227
Redis实现原理(1)--链表
链表是Redis中使用非常广泛的一种数据结构,很多地方如List结构底层就是用链表实现的。链表的定义在头文件adlist.h 中,很常见的双向链表,结构如下: 1 // 链表节点 2 typedef struct listNode { 3 struct listNode *prev; //指...
分类:其他好文   时间:2014-08-03 01:45:04    阅读次数:347
0724------Linux基础----------进程1
1.进程的基本概念 1.1操作系统有三大抽象概念: a)进程:程序的执行过程; b)文件: IO; c)虚拟内存:可用的地址空间; 1.2 进程在内核中是一种数据结构 task_struct(定义见/usr/src/linux-headers-3.8.0-29/include/...
分类:系统相关   时间:2014-08-02 23:19:24    阅读次数:378
swift中的nil与Objective-C中的nil区别
1.OC中,只有对象才能设置为nil,而swift中除了对象,Int、struct、enum等任何可选类型都可以等于nil2.OC中,nil是一个指向不存在对象的指针。swift中,nil不是指针,nil是个确定的值,用来表示值缺失。
分类:其他好文   时间:2014-08-02 23:06:34    阅读次数:281
POJ 3119 Friends or Enemies?
先预处理得到各个编号的点的位置再判断 点在二元一次方程的上方还是下方#include #include #include #include #include #include #include #include #include #include using namespace std; #define MAXN 11111 #include #include struct ...
分类:其他好文   时间:2014-08-02 20:56:44    阅读次数:241
单链表
struct Node{ int data; Node *next;};//创建链表 输入为数字,如果输入0 链表结束(0不计)Node *creat(){ Node *head,*p,*s; int x,cycle=1; head=(Node *)malloc(siz...
分类:其他好文   时间:2014-08-02 20:50:24    阅读次数:292
linux进程调度函数浅析(基于3.16-rc4)
众所周知,进程调度使用schedule()函数来完成,下面我们从分析该函数开始,代码如下(kernel/sched/core.c):1 asmlinkage __visible void __sched schedule(void)2 {3 struct task_struct *tsk =...
分类:系统相关   时间:2014-08-02 17:58:03    阅读次数:396
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!