- 博客(12)
- 资源 (1)
- 收藏
- 关注
原创 【String】引用计数实现String
String.h#ifndef STRING_H#define STRING_H#define _CRT_SECURE_NO_WARNINGS#include//Stringclass String{public: String(const char* str = NULL);//constructor String(const String& rhs);//copy cons
2015-11-29 20:45:44 731 1
原创 【栈,队列】两队列实现栈
一、用STL的queue实现MyStack.h#ifndef MYSTACK_H#define MYSTACK_H#include#include//MyStacktemplateclass MyStack{public: typedef T value_type; typedef T& reference; MyStack();//constructor ~MyS
2015-11-21 15:17:25 446
原创 【栈,队列】两栈实现队列
一、用STL中的stack实现MyQueue.h#ifndef MYQUEUE_H#define MYQUEUE_h#include#include//MyQueuetemplateclass MyQueue{public: typedef T value_type; typedef T& reference; MyQueue();//constructor ~My
2015-11-15 14:00:12 318
原创 【栈】两栈共享空间
SeqDoubleStack.h#ifndef SEQDOUBLESTACK_H#define SEQDOUBLESTACK_H#includeint default_size = 20;// SeqDoubleStacktemplateclass SeqDoubleStack{public: typedef T& reference; SeqDoubleStack(int
2015-11-15 10:38:22 359
原创 【队列】链式队列
LinkedQueue.h#ifndef LINKEDQUEUE_H#define LINKEDQUEUE_h#include//queue nodetemplatestruct queue_node{ typedef queue_node* pointer; T data; pointer next; queue_node() :next(NULL){} queue_n
2015-11-14 13:57:13 350
原创 【队列】循环队列
CircularQueue.h#ifndef CIRCULARQUEUE_H#define CIRCULARQUEUE_Hint default_size = 10;#include//CircularQueuetemplateclass CircularQueue{public: typedef T& reference; CircularQueue(int size
2015-11-14 10:36:38 324
原创 【栈】链式栈
LinkedStack.h#ifndef LINKEDSTACK_H#define LINKEDSTACK_H#include//Stack nodetemplatestruct stack_node{ typedef stack_node* pointer; T data; pointer next; stack_node() :next(NULL){} stack_n
2015-11-11 21:48:46 308
原创 【栈】顺序栈
SeqStack.h#ifndef SEQSTACK_H#define SEQSTACK_H#includeint default_size = 20;// SeqStacktemplateclass SeqStack{public: typedef T& reference; SeqStack(int size = default_size);//constructor
2015-11-11 21:38:39 328
原创 【线性表】静态链表
StaticLinkedList.h#ifndef STATICLINKEDLIST_H#define STATICLINKEDLIST_H#includeconst int max_size = 1000;//list nodetemplatestruct list_node{ T data; int cur;//cursor};//StaticLinkedList
2015-11-08 20:52:32 363
原创 【线性表】双向循环链表
DualCirculationList.h#ifndef DUALCIRCULATIONLIST_H#define DUALCIRCULATIONLIST_H#include//list nodetemplatestruct list_node{ typedef list_node* pointer; T data; pointer prior; p
2015-11-08 18:38:46 328
原创 【线性表】单链表
SingleLinkedList.h#ifndef SINGLELINKEDLIST_H#define SINGLELINKEDLIST_H#include//list nodetemplatestruct list_node{ typedef list_node* pointer; T data; pointer next; list_node() :next(NULL)
2015-11-08 14:16:25 315
原创 【线性表】顺序表
SeqList.h#ifndef SEQLIST_H#define SEQLIST_H#includeconst int default_size = 100;//SeqListtemplateclass SeqList{public: typedef T value_type; typedef T* pointer; SeqList(int size = defaul
2015-11-07 15:07:22 341
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人