码迷,mamicode.com
首页 >  
搜索关键字:assert    ( 2161个结果
字符串转浮点数 字符串转整型数
#define_CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<assert.h> doubleAtOf(constchar*ptr); doubleAtOi(constchar*ptr) { assert(ptr); doublevalue=0.0; doublesign=0; while(*ptr==‘‘)//跳过空格 { ptr++; } if(*ptr==‘+‘||*p..
分类:其他好文   时间:2016-03-29 22:30:03    阅读次数:324
用仿函数实现大小堆及堆排序
"2.h" #include<iostream> #include<vector> #include<assert.h> usingnamespacestd; template<classT> structLess { booloperator()(constT&left,constT&right) { returnleft<right; } }; template<classT> structGreater { b..
分类:编程语言   时间:2016-03-29 22:29:56    阅读次数:501
一天一个Java类之Java关键字
关键字含义abstract表明类或者成员方法具有抽象属性assert用来进行程序调试boolean基本数据类型之一,布尔类型break提前跳出一个块byte基本数据类型之一,字节类型case用在switch语句之中,表示其中的一个分支catch用在异常处理中,用来捕捉异常char基本数据类型之一,字符类型..
分类:编程语言   时间:2016-03-29 06:32:31    阅读次数:247
单链表(C语言)
单链表:单向无循环,最后置于空//SeqList.h#pragmaonce #include<string.h> #include<stdlib.h> #include<assert.h> #defineMAX_SIZE100 typedefintDataType; typedefstructSeqlist { DataType*_array; size_t_size; size_t_capacity; }Seqlist; voidI..
分类:编程语言   时间:2016-03-28 22:06:19    阅读次数:236
单链表(C语言)基本操作
单链表:单向有序链表最后置于空#pragmaonce #include<string.h> #include<malloc.h> #include<assert.h> typedefintDataType; typedefstructListNode { structListNode*_next; DataType_data; }ListNode; voidPrintList(ListNode*&pHead) { while..
分类:编程语言   时间:2016-03-28 22:05:50    阅读次数:230
单链表 --- 冒泡排序 约瑟夫环
1.冒泡排序:voidBubbleSort(ListNode*&pHead)//冒泡排序 { ListNode*tail=NULL; assert(pHead!=NULL&&pHead->_next!=NULL); while(tail!=pHead->_next) { ListNode*prev=pHead; ListNode*cur=pHead->_next; while(cur!=tail)//单次排序 { ..
分类:编程语言   时间:2016-03-28 22:02:01    阅读次数:303
二叉树的线索遍历
#include<iostream> #include<assert.h> usingnamespacestd; enumPointerTag { THREAD, LINK }; template<classT> structBinaryTreeNodeThd { T_data; BinaryTreeNodeThd<T>*_left; BinaryTreeNodeThd<T>*_right; BinaryTreeNodeThd<T&..
分类:其他好文   时间:2016-03-28 19:02:01    阅读次数:256
C语言实现单链表的基本操作及其部分面试题
//单链表的基本数据类型及其结构typedefintDataType;typedefstructLinkNode{DataTypedata;structLinkNode*next;}LinkNode,*pLinkNode,*pLinkList;//单链表的初始化voidInitLinkList(pLinkList*pHead)//初始化{assert(pHead);*pHead=NULL;}//当尾插,头插,插入时都需要建立一个..
分类:编程语言   时间:2016-03-28 18:51:03    阅读次数:442
广义表
//求深度的那儿得好好推敲 #include<iostream> #include<assert.h> usingnamespacestd; typedefcharelemType; enumNodeType { HEAD, VALUE, SUB }; structGNode { NodeType_type; GNode*_next; union { elemType_value; GNode*_subList; }; GNode(Nod..
分类:其他好文   时间:2016-03-28 00:29:57    阅读次数:222
内存管理
MemoryManage.h #include<string> #include<list> #include<assert.h> #include"TypeTraits.hpp" #include<iostream> usingnamespacestd; structBlockInfo { void*_ptr; string_file; int_line; BlockInfo(void*ptr=0,char*file="",intline=0)// ..
分类:其他好文   时间:2016-03-28 00:29:21    阅读次数:208
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!