03 2019 档案
摘要:总结:析构器在析构时,若未定义str2的临时指针变量,str2会析构错误;不要改变指针位置,使用下标进行比较
阅读全文
摘要:#include #include #define MAXSIZE 5 using namespace std; typedef struct { char *elem; //储存空间基地址 int length; //当前长度 }SqList; //初始化顺序表 int InitList(SqList *L) { L->elem=new char[MAXSIZE];...
阅读全文
摘要:#if 1 #include #include using namespace std; class List { public: //默认构造函数集合大小为6个元素 List(); //构造函数重载,可接受参数,改变集合大小 List(int size); //析构函数释放str, ~List() { delete []str; } //打印数据 voi...
阅读全文
摘要:#if 1 #include #include #include using namespace std; struct Node { int data; Node *next; }; //初始化 Node *init() { Node *head=new Node; head->next=NULL; return head; } //头插法创建节点 void insetLis...
阅读全文
摘要:#if 1 #include #include #include using namespace std; struct Node { int data; Node *next; }; //初始化 Node *init() { Node *head=new Node; head->next=NULL; return head; } //头插法创建节点 void insetLis...
阅读全文
摘要:#if 1 #include #include #include using namespace std; struct Node { int data; Node *next; }; //初始化 Node *init() { Node *head=new Node; head->next=NULL; return head; } //头插法创建节点 void insetLis...
阅读全文
摘要:总结:链表的遍历注意不要随意改变头指针的位置,进行合并时需要声明三个结构体指针用于进行合并,注意某一链表结束时需要进行链接,再释放生成的链表.
阅读全文
摘要:#if 1 #include #include #include #include #include using namespace std; //类 class List { public: //构造器初始化,生成头节点 List() { head = new Node; head->next=NULL; } //成员函数 void createLis...
阅读全文

浙公网安备 33010602011771号