#include
#include
#include
#define ZERO 0
const int FIRST_CHAR = '0';
char num[11111][20] ;
typedef struct node
{
struct node *child[20]; /* 存储下一个字符 */
int n; /* 记录当前单词出现的次数 */
}node, *No...
分类:
其他好文 时间:
2014-07-22 08:31:36
阅读次数:
205
#include?<iostream>
#include?<algorithm>
using?namespace?std;
//回调函数
void?call_back(char?elem)
{
?cout?<<?elem?<<?endl;
}
//仿函数
struct?Functor
{
?void?operator()?(char?elem)...
分类:
其他好文 时间:
2014-07-22 08:13:37
阅读次数:
316
直接上代码 struct People{
int age;
}
int main(){
struct People * p= malloc(sizeof(struct Perople));
p->age=10;
struct People * p1=p;
p-age=12;
printf("%d\n",p1->age);
free(p);
return 0;
}
} 函...
分类:
编程语言 时间:
2014-07-21 10:22:57
阅读次数:
222
//algorithm.henum SWAP_TYPE{MEMORY, COMPLEX};struct SIntArray{ int *pData; int num; SIntArray():pData(NULL),num(0){} void Clear(){delete ...
分类:
其他好文 时间:
2014-07-21 09:38:33
阅读次数:
263
1、链表的反转 #include#includeusing namespace std;typedef struct ListNode{ int data; struct ListNode * Next;}ListNode;ListNode *ReverseList(ListNode *pHead)...
分类:
其他好文 时间:
2014-07-21 09:34:40
阅读次数:
197
约瑟夫环是一个数学的应用问题:已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。
C代码如下:
#include
#include
#include
typedef struct _node
{
struct _node* next;...
分类:
其他好文 时间:
2014-07-21 09:32:50
阅读次数:
222
一.类与结构的示例比较: 结构示例: 1 public struct Person 2 { 3 string Name; 4 int height; 5 int weight 6 public bool overWeight() 7 { 8 //implement something ...
分类:
其他好文 时间:
2014-07-20 23:39:51
阅读次数:
317
#include
#include
#include
#define ZERO 0
const int FIRST_CHAR = '0';
char num[11111][20] ;
typedef struct node
{
struct node *child[20]; /* 存储下一个字符 */
int n; /* 记录当前单词出现的次数 */
}node, *No...
分类:
其他好文 时间:
2014-07-20 11:32:38
阅读次数:
215
1.带表头的单向链表
(1)不带表头的单向链表在实现插入和删除时必须区分头结点和其他节点的处理。
(2)使用带表头的单向链表的好处:不用考虑头结点的单独处理。
表头节点:数据域没有值,指针域指向单向链表中数据域含值的第一个结点。
2.代表头的单向链表的基本操作
#include
#include
#define NULL 0
typedef struct node {
int ...
分类:
其他好文 时间:
2014-07-20 10:31:16
阅读次数:
250