码迷,mamicode.com
首页 >  
搜索关键字:struct enum    ( 22969个结果
Swift实现OC中的单例模式
一、MySingle类 import Foundation class MySingle{ //定义单例的属性 var name:String? var age:Int? var height:Double? //定义类方法 class func shareInstance()->MySingle{ struct qzSingle...
分类:其他好文   时间:2014-06-16 12:04:04    阅读次数:272
每天一个小算法(4)----在O(1)时间删除指定结点
O(1)时间内删除结点的思路只能是复制该结点下一个结点的数据,然后删除该结点的下一个结点,来等效删除此结点。需要注意的地方是删除头结点和尾结点的处理。 1 #include 2 #include 3 #include 4 typedef struct Node 5 { 6 int da...
分类:其他好文   时间:2014-06-15 17:05:10    阅读次数:107
消息队列实现实时通信
此实例是一个简单的使用消息队列进行实时聊天的本机通信程序,,发送端每发送一个消息,会立即被接收读取,在没有消息在消息队列中时,将处于阻塞状态。终端1运行接收端#include #include #include #include #include #include #include struct m...
分类:其他好文   时间:2014-06-15 06:24:47    阅读次数:206
Codeforces Round #245 (Div. 2) A - Points and Segments (easy)
水到家了#include #include #include using namespace std;struct Point{ int index, pos; Point(int index_ = 0, int pos_ = 0){ index = index_; ...
分类:其他好文   时间:2014-06-14 21:21:40    阅读次数:281
Java 枚举类
public enum Season2 implements Info{ spring("春天","春风又路江南岸"), summer("夏天","映日荷花别样红"), autumn("秋天","秋水共长天一色"), winter("冬天","千树万树梨花开"); final String seas...
分类:编程语言   时间:2014-06-14 20:15:58    阅读次数:237
数据结构—线性表
存放学生表的链表的结点类型:typedef struct studentnod{ int no; char name[8]; char sex[2]; char class[4]; struct studentnod *next;}stuType;线性表:是具有相同特性的数据元素的一个有限序列;线性...
分类:其他好文   时间:2014-06-14 19:30:52    阅读次数:210
c++实现二叉搜索树
自己实现了一下二叉搜索树的数据结构,记录一下: #include using namespace std; struct TreeNode{ int val; TreeNode *left; TreeNode *right; TreeNode(int value) { val=value; left=NULL; right=NULL; } }; clas...
分类:编程语言   时间:2014-06-14 13:36:40    阅读次数:265
矩阵快速幂
复杂度为o(n^3logk) /* 求 a^k % mod,其中a是n*n的矩阵 */ const int mod = 10000; const int maxn = 2; _LL k; int n; struct matrix { _LL mat[maxn][maxn]; } a,res; matrix mul(matrix x, matrix y) { matrix tmp...
分类:其他好文   时间:2014-06-14 07:46:19    阅读次数:206
Swift学习笔记十:属性
1、存储属性       1. 作为特定类或结构实例的一部分,存储属性存储着常量或者变量的值。存储属性可分为变量存储属性(关键字var描述)和常量存储属性(关键字let描述)。 struct student{ let name = "" var score = 0 } let a = student(name:"小笨狼",score:96)           注意:   ...
分类:其他好文   时间:2014-06-14 07:15:21    阅读次数:309
DM8168 PWM驱动与测试程序
昨天把DM8168的Timer设置给摸了一遍,为写PWM的底层驱动做好了准备,现在就要进入主题了。 dm8168_pwm.c: #include #include #include #include /* copy_to_user,copy_from_user */ #include #include #include static struct class *pwm_cla...
分类:其他好文   时间:2014-06-14 06:06:27    阅读次数:234
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!