摘要: 二叉树遍历有先序遍历、中序遍历、后序遍历。下面有递归和非递归的方式:#include "Status.h"#include typedef struct BiTNode { TElemType data; struct BiTNode *LChild, *RChild;}BiTNo... 阅读全文
posted @ 2014-11-17 18:30 tt_tt---> 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目1511:从尾到头打印链表 题解报告:方法一、链表创建,头插法,方法二、运用栈,注意栈可能溢出~! #include #include #include using namespace std;// stackint main(){ int num; ... 阅读全文
posted @ 2014-11-09 20:05 tt_tt---> 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目1510:替换空格 题解报告: 水题,注意数据,我是用最简单的办法,一扫而替换,判断的时候注意,s[i]!=0,全局数组初始化默认为0,我开始用了strlen(s)判断,超了不少时,哎呀!#include #include #include char s[10000001];int ... 阅读全文
posted @ 2014-11-09 12:18 tt_tt---> 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 题目1384:二维数组中的查找 题解报告:一道典型的二分查找题,用C++做居然超时>1000MS,郁闷半天!,该成C,提交680MS过,C还是很快的! #include #include int a[1010][1010];int main(){ ... 阅读全文
posted @ 2014-11-09 10:58 tt_tt---> 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 简单实现数据结构之循环队列#include #include #include #define OK 1#define FALSE 0#define ERROR -1#define OVERFLOW -2#define TRUE 1#define FALSE 0using namespace st... 阅读全文
posted @ 2014-10-22 20:23 tt_tt---> 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 简单实现数据结构队列#include #include #include #include #define OK 1#define OVERFLOW -1#define ERROR -1#define TRUE 1#define FALSE 0using namespace std;struct... 阅读全文
posted @ 2014-10-21 20:10 tt_tt---> 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 简单实现单链表操作!#include #include #include #include using namespace std;typedef struct Lnode{ int data; struct Lnode *next;}Lnode, *Linklist;//初始... 阅读全文
posted @ 2014-10-17 10:14 tt_tt---> 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 简单的实现以下栈的数据结构: #include #include #include #include typedef struct Stack{ int *Base; int Top; int Size;}Sqstack;const int Const_size = 20;usi... 阅读全文
posted @ 2014-10-15 17:36 tt_tt---> 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 前言 编程挑战 计算机日期 #include #include #include int main(){ time_t biggest = 0x7FFFFFFF; printf("biggest = %s \n", asctime(gmtime(&biggest))); return ... 阅读全文
posted @ 2014-09-06 11:25 tt_tt---> 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 抽象类是一种特殊的类,它是为了抽象和设计的目的为建立的,它处于继承层次结构的较上层。 ⑴抽象类的定义: 称带有纯虚函数的类为抽象类。 ⑵抽象类的作用: 抽象类的主要作用是将有关的操作作为结果接口组织在一个继承层次结构中,由它来为派生类提供一个公共的根,派生类将具体实现在其基类中作为接口的操作。所以派... 阅读全文
posted @ 2014-08-31 15:55 tt_tt---> 阅读(1350) 评论(0) 推荐(0) 编辑