1:C++主要是对于C的继承性做的相当的出色,主要扩充在于程序员可以自己定义自己的数据结构,用数据结构去描述日常生活中的事务,而不是C语言中当当仅有的Struct数据类型等等2:
每一种语言都有自己的编程风格,需要通过实践去养成自己的编程习惯3:程序与算法的区别【1】目的性:算法是求解目的的一系列动...
分类:
编程语言 时间:
2014-06-06 13:08:26
阅读次数:
320
#define MSG_HEAD_LEN 4//消息头部结构typedef struct tagMsg
{ //消息类型 u16 type; //消息体长度 u16 length;}TMsg;void receive(SOCKET s){ char
buffer[1024*28]; //CServM...
分类:
其他好文 时间:
2014-06-06 11:25:33
阅读次数:
243
Sort a linked list using insertion sort./** *
Definition for singly-linked list. * struct ListNode { * int val; * ListNode
*next; * ListNo...
分类:
其他好文 时间:
2014-06-06 10:39:38
阅读次数:
212
测试 代码运行时间linux 中的 中 有个函数可以获取当前时间,精确到 微秒
----> gettimeofday() 1 #include // int gettimeofday(struct timeval *tv,
struct timezone *tz); 2 /***...
分类:
系统相关 时间:
2014-06-06 09:10:48
阅读次数:
248
#include#includetypedef struct Node{ int
data; struct Node *next;}LinkList;//就地反转int LinkListRerverse(LinkList
*head){ LinkList *q,*p; p = head->next;...
分类:
其他好文 时间:
2014-06-06 07:35:54
阅读次数:
283
示例代码注重这里p1的作用以下代码是用尾插法添加结点#include #include #define
N sizeof (STU)typedef struct stu{ int num; char name[20];} STU, * PSTU;PSTU
creat (PSTU head) ...
分类:
其他好文 时间:
2014-06-05 19:49:50
阅读次数:
351
1概述
在计算机编程语言中用来为复杂的声明定义简单的别名,与宏定义有些差异,它本身是一种存储类的关键字,与auto、extern、mutable、static、register等关键字不能出现在同一个表达式中。2定义
typedef声明,简称typedef,为现有类型创建一个新的名字,或称为类型.....
分类:
其他好文 时间:
2014-06-05 18:38:46
阅读次数:
365
三元组表的C++语言描述基本运算的算法——建立稀疏矩阵的三元组表的算法、按矩阵的列序转置算法、按矩阵的行序转置算法#includeusing namespace
std;template class sanyuanzu{ private: struct Node {...
分类:
其他好文 时间:
2014-06-05 18:29:41
阅读次数:
318
十字链表的语言描述基本运算的算法——建立稀疏矩阵的十字链表的算法、输出稀疏矩阵十字链表的算法#includeusing namespace
std;template class shizi{private: struct Node { int i; int j...
分类:
其他好文 时间:
2014-06-05 18:25:08
阅读次数:
272
题意:给定N中货币 两种货币之间可以兑换 并且收取一定的费用 问 给定你一种货币与数量
是否能兑换到原来的货币 使自己的货币增加思路:用bellman算法 判断是否有回路不断的增大;#include#includeusing namespace
std;struct Node{ int u,v; d...
分类:
其他好文 时间:
2014-06-05 18:18:16
阅读次数:
178