码迷,mamicode.com
首页 >  
搜索关键字:struct    ( 18973个结果
C#高级编程(第8版)——委托声明、使用(第一节)
首先,声明一个Currency的结构。Currency结构有自己的ToString()重载方法和一个与GetCurrencyUnit()的签名相同的静态方法。这样,就可以用同一个委托变量调用这些方法了: struct Currency { public uint Dollars...
分类:其他好文   时间:2014-07-07 17:01:13    阅读次数:121
[Leetcode][Tree][Binary Tree Level Order Traversal ]
树的层次遍历,比较简单,3个题的做法完全一样,只是在特定的地方对结果进行reverse。1、Binary Tree Level Order Traversal/** * Definition for binary tree * struct TreeNode { * int val; * ...
分类:其他好文   时间:2014-07-07 16:39:56    阅读次数:194
[Leetcode][Tree][Same Tree]
非常简单的一道题/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x...
分类:其他好文   时间:2014-07-07 16:25:49    阅读次数:220
Problem Populating Next Right Pointers in Each Node
Problem Description:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Popul...
分类:其他好文   时间:2014-07-07 15:45:18    阅读次数:166
[Leetcode][Tree][Depth of Binary Tree]
计算树的深度1、minimum depth of binary tree 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * ...
分类:其他好文   时间:2014-07-07 15:31:40    阅读次数:182
【POJ】3283 Card Hands
字典树。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 #define TRIEN 56 9 10 typedef struct Trie {11 Trie *n...
分类:其他好文   时间:2014-06-30 11:39:28    阅读次数:210
Linux struct itimerval用法
先看一段代码 #include #include #include #include #include static int count = 0; void set_timer() { struct itimerval itv; itv.it_value.tv_sec = 3; //timer start after 3 seconds later itv.it...
分类:系统相关   时间:2014-06-30 10:31:41    阅读次数:365
C/C++中避免系统的字节对齐
在定义了一个新的Struct后。 系统会按照一定的规则将新生命的类型变量进行字节对齐,如下结构体: typedef struct Test{ int a; char b[6]; }Test; 该结构体类型可能会被对齐为12个字节。 那么,在内存流和文件流操作中可能会出现这样的用法: fwrite(strPtr,1,sizeof(Test)*len,fp); 事实上,被写入了len...
分类:编程语言   时间:2014-06-29 23:36:49    阅读次数:388
hdu 3264 Open-air shopping malls 求两圆相交
对每个圆二分半径寻找可行的最小半径,然后取最小的一个半径。 对于两圆相交就只要求到两个扇形,然后减去两个全等三角形就行了。 #include #include #include #include using namespace std; #define pi acos(-1.0) #define eps 1e-8 #define maxn 50 int n; struct point{...
分类:其他好文   时间:2014-06-29 22:36:16    阅读次数:247
词法分析器 /c++实现
#include #include #include #include #include #include #include using namespace std; int line=1,row=1; char c; mapma; struct kind { string na; //单词 int num; //内码 string type; //类型 ...
分类:编程语言   时间:2014-06-29 20:37:12    阅读次数:195
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!