搜索资源列表
cmoban
- 参照栈类模板的例子编写一个队列类模板class <T> Queue,私有成员包括:队首指针Front,队尾指针Tail,队列容积max。实现:构造函数Queue,析构函数,入队函数In,出队函数Out(每次出队,后面的元素自动前移一位),判队列空函数Empty。并分别用队列类模板定义int和float对象,调用各个成员函数-reference stack class template examples of the preparation of a class template cl
cclassshape
- 声明一个基类Shape(点), 在此基础上派生出Rectangle(长方形)和Circle(圆),这三个类都有GetArea()函数计算对象的面积,构造函数,析构函数等有关函数。再使用Rectangle类创建一个派生类Square(正方形)。并设计创建各种类的对象,调用所有函数。设计函数f(Shape &a)能对不同对象的实参调用计算打印出对象的面积。 -statement a base class Shape (points) On this basis -- for Rectangle
pet
- 演示类继承,派生的良好教程。可观察构造函数和析构函数的调用顺序,以及冲在构造函数时的参数继承顺序。-demonstration class inheritance, derived from the good guidance. Observed Constructors and Destructors function call sequences, and the structure-function of the parameters of the order of succession.
stack
- 不带头结点的链式堆栈类,1、 定义并实现不带头结点的链式堆栈类,除构造和析构函数外,成员函数还有入栈、出栈、取栈顶元素、判断堆栈是否非空,头文件为“nohead_LinStack.h”。-node does not take the lead in the category of chain stack, 1, and the definition does not take the lead in realizing the chain nodes stack category, In add
circlechain
- 定义并实现带头结点的循环双向链表类,除构造和析构函数外,成员函数还有取数据元素个数、插入、删除、取数据元素-definition and take the lead in achieving the cycle node type two-way linked list, in addition to the structural and destructor function, members also function from the number of data elements, in
数据结构的C++描述
- 目 录 译者序 前言 第一部分 预备知识 第1章 C++程序设计 1 1.1 引言 1 1.2 函数与参数 2 1.2.1 传值参数 2 1.2.2 模板函数 3 1.2.3 引用参数 3 1.2.4 常量引用参数 4 1.2.5 返回值 4 1.2.6 递归函数 5 1.3 动态存储分配
string
- 1、为该类设计构造函数和析构函数,要求构造函数不少于两个 2、为该类设计合理的成员变量 3、为string类提供必要的成员函数,可以参考C++类库的string类提供了那些成员函数,起码包括字符查找 获得C风格字符串、获得字符串长度、字符串比较等。 4、要求该类的设计有良好的封装性 5、有一个能正常运行的测试程序,测试该类的所有成员函数-1, the design for the class constructor and destructor, constructor re
lianbiao
- 修改单链表模板类,使结点类的数据域改为数据类对象的指针。要求为该单链表模板类建立深复制函数,这需要结点类和学生类的复制构造函数均为深复制。其中学生类的深复制是调用string类的复制构造函数完成的,直接用默认的,同样析构函数也不要重编。 并据此建立一个学生链表,原始数据放在文本文件EXP19_2.txt中。 -Modify the linked list template class, so that node data fields to the data class class ob
BinaryTree
- 二叉树二叉链表实现 (1) 构造(包括拷贝构造)和析构函数(删除所有结点函数); (2) 根据用户输入的先序遍历序列构造二叉树; (3) 打印二叉树(可以使用先序、中序、后序遍历实现); (4) 分别求二叉树中所有结点的个数;叶子结点、分支结点的个数; (5) 分别求二叉树的高度(层次数); (6) 按层次打印二叉树; (7) 使用另一种方式创建二叉树:规则:左子树的值都比根结点小,右子树的值都不比根结点小; -Binary Tree
asd
- 1. 编写程序完成如下功能: ⑴ 编写一个自己的字符串类MyString,它有一个私有的数据成员:指向字符串的指针m_data。编写该类的构造函数、拷贝构造函数和析构函数,在构造函数和拷贝构造函数中动态申请内存空间赋值给m_data。用于存储字符串。在析构函数中释放内存空间。 ⑵ 重载运算符“+”作为类MyString的成员函数,使能完成字符串相加功能。 ⑶ 编写main函数,测试该类及被重载的运算符。-A written procedure performs the fol
linksqelist
- 能够自动调用链表的构造函数和析构函数,能对链表进行插入、删除操作,若不能,则程序能够报错。-The linked list can automatically call the constructor and destructor of the linked list, insert and delete operations, if not, the program is capable of error.
The-constructor-and-destructor
- 学习使用构造函数和析构函数的小程序,通过观察运行结果来更好的学习-Learn to use the constructor and destructor small program run by looking to better learning results