码迷,mamicode.com
首页 >  
搜索关键字:cassert    ( 101个结果
链表模板、队列模板、顺序表模板、栈模板、
//利用容器适配器实现栈和队列 #pragmaonce #include<iostream> #include<string> #include<cassert> usingnamespacestd; template<typenameT> structNode { public: Node(constT&d) :_next(NULL) ,_prev(NULL) ,_data(d){} T_data; N..
分类:其他好文   时间:2016-09-06 23:31:54    阅读次数:174
数据结构C++实现基本的堆
#pragmaonce#include<vector>#include<queue>#include<cassert>#include<iostream>usingnamespacestd;//仿函数实现在建堆时确定(大小堆)template<classT>structGreater{ booloperator()(constT&left,constT&right) { returnleft>r..
分类:编程语言   时间:2016-07-11 09:12:51    阅读次数:215
jsoncpp学习
// MyJsonTest.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <fstream> #include <cassert> #include "json/json.h" using namespace std; /********* ...
分类:Web程序   时间:2016-05-30 14:31:42    阅读次数:284
动态数组类
在动态数组类中,通过类的成员函数访问数组元素,可以在每次访问之前检查一下下标是否越界,使得数组下标越界的错误能够及早被发现。这种检查,可以通过C++的assert来进行。assert的含义是“断言”,它是标准C++的cassert头文件中定义的一个宏,用来判断一个条件表达式的值是否为true,如果不为true,则程序会中止,并且报告出错误,这样就很容易将错误定位。 以下是一个简单的动态数组类示例...
分类:编程语言   时间:2016-05-13 00:46:25    阅读次数:166
广义表的实现
广义表:非线性结构,是线性表的一种扩展,是有n个元素组成有限序列,是递归的,因为在表的描述中又得到了表,允许表中有表。#include<cassert> #include<iostream> usingnamespacestd; enumType//枚举节点的类型 { HEAD,//头结点 VALUE,//有数据成员的节点 SU..
分类:其他好文   时间:2016-05-11 20:11:07    阅读次数:171
用双向链表实现大数加减法
写了5个小时,C++面向对象的东西都不会写了。。。以后要多写C++少写python。。。关于读入字符串处理的那部分写得太挫就不放了。 #include "List.hpp" 1 #pragma once 2 #include <cstdio> 3 #include <cassert> 4 5 nam ...
分类:其他好文   时间:2016-05-09 21:58:46    阅读次数:247
广义表的C++简单实现
广义表是数据结构中非常关键的一部分,它的学习对于树和二叉树有很大的起承作用。那么,它是怎么实现的呢?广义表的实现应用到了一个很熟悉的算法——递归。来看看它的代码吧!#pragmaonce #include<iostream> #include<cassert> usingnamespacestd; enumType { ..
分类:编程语言   时间:2016-04-20 18:20:37    阅读次数:363
广义表
广义表(Lists,又称列表)是一种非线性的数据结构,是线性表的一种推广。即广义表中放松对表元素的原子限制,容许它们具有其自身结构。如图,根据上图分析写出代码如下;#include<cassert> #include<iostream> usingnamespacestd; enumType { HEAD, VALUE, SUB, ..
分类:其他好文   时间:2016-04-19 14:29:19    阅读次数:260
迷宫问题并求最短路径
#include<iostream> #include<cassert> #include<stack> #include<vector> structPos { int_row; int_col; }; boolMinPath(vector<vector<int>>&maze,introw,intcol,Posenrty,stack<Pos>&minPath) { assert(!maze.empt..
分类:其他好文   时间:2016-04-13 00:34:15    阅读次数:162
迷宫问题
#include<iostream> #include<cassert> #include<stack> #include<vector> structPos { int_row; int_col; }; voidGetMaze(int*&a,int&row,int&col) { std::FILE*fileMaze=fopen("C:\\Users\\朱潇翔\\Desktop\\迷宫.txt","r"); asse..
分类:其他好文   时间:2016-04-13 00:31:46    阅读次数:209
101条   上一页 1 ... 7 8 9 10 11 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!