码迷,mamicode.com
首页 >  
搜索关键字:typedef struct    ( 24378个结果
算法与数据结构--图的实现、基本操作及应用
#include #include #include using namespace std; #define INFINITY DBL_MAX //无穷大 #define MAX_VERTEX_NUM 20 //最大顶点个数 enum GraphKind //图的类型 { DG,DN,UDG,UDN//有向图、有向网、无向图、无向网 }; //弧结构 typedef struct...
分类:其他好文   时间:2014-06-07 01:52:18    阅读次数:214
判断是否有权限访问相机,相册,定位
1.判断用户是否有权限访问相册 #import ALAuthorizationStatus author = [ALAssetsLibraryauthorizationStatus]; if (author == kCLAuthorizationStatusRestricted || author ==kCLAuthorizationStatusDenied) ...
分类:其他好文   时间:2014-06-05 11:39:50    阅读次数:265
实现自己的软件定时器
为什么要实现软件定时器: 在芯片上,地址空间也是相当宝贵的,如果保留了更多的硬件定时器的话,就需要更多的地址空间,那么我们能不能作个折中方案呢?答案是肯定的,我们可以使用一个硬件定时器,来模拟实现一个软件定时器,可以满足更多的定时需求,需要注意的一点就是软件定时器精度可能会有稍微误差,因为会涉及到任务调度、锁中断等,在对定时精度要求不高的场景,可以考虑使用软件定时器。Linux内核中的timer...
分类:其他好文   时间:2014-06-05 11:38:35    阅读次数:242
[数据结构] 二叉树的建立及其基本操作
如图: 代码:   #include #include #include #include using namespace std; char ch; typedef struct BinNode { char data; struct BinNode *lchild,*rchild; }BinNode,*BinTree; //二叉树链式...
分类:其他好文   时间:2014-06-05 09:15:24    阅读次数:203
用二叉链表实现二叉查找树(二)
/* 二叉查找树的链表实现: 以及三种遍历方式,删除节点; 查找节点; author:天下无双 Date:2014-5-28 Version:3.0 */ #include #include typedef int T;//树内节点的数据类型 using namespace std; class BiTree { private: struct BiNode{ T data;...
分类:其他好文   时间:2014-06-05 09:12:12    阅读次数:217
栈的应用举例-进行算术运算
这个例子是来自于严蔚敏的《数据结构》的栈那一节。 但是我进行了一些简单的修改,确保编译通过。 目的:利用栈 计算 “3*(7-2)”这样的字符串的算术运算的结果。 共有3个代码文件,如下: 1、mystack.h         #pragma once #define maxsize 30 typedef struct { char data[maxsize+1]; ...
分类:其他好文   时间:2014-06-05 07:35:18    阅读次数:242
二叉树的链表实现
直接上代码: /* 二叉树的链表实现: 以及三种遍历方式: author:天下无双 Date:2014-5-28 Version:2.0 */ #include #include typedef int T;//树内节点的数据类型 using namespace std; class BiTree { private: struct BiNode{ T data; BiN...
分类:其他好文   时间:2014-06-05 06:30:49    阅读次数:273
POJ - 1111 Image Perimeters
题意:求'X'围成的周长 思路:按理说每增加一个就是周长加4,但是要减去重复的地方,这里我是用BFS做的,如果是BFS的模板思路的话是不行的,应该要先取出再标记 #include #include #include #include #include using namespace std; const int MAXN = 30; struct node { int x,y; ...
分类:其他好文   时间:2014-06-05 06:23:39    阅读次数:221
hdu 1863 畅通工程
题目:         链接:点击打开链接 题意:         中文题 算法: 思路:         赤裸裸的最小生成树。。 代码: #include #include using namespace std; struct node{ int u,v,w; } e[110]; int p[110]; int n,m,sum,ans; int cmp(node...
分类:其他好文   时间:2014-06-05 03:50:23    阅读次数:232
Linux下I/O复用 Select与Poll
Select#include #include #include int select (int n, fd_setreadfds, fd_setwritefds, fd_setexceptfds, struct timevaltimeout);FD_CLR(int fd, fd_set *set)...
分类:系统相关   时间:2014-05-31 02:32:17    阅读次数:508
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!