mirror of
https://github.com/Didnelpsun/CS408.git
synced 2026-02-06 12:23:47 +08:00
更新数据结构
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
// 测试文件
|
||||
// 测试文件
|
||||
|
||||
#include "../head/sequence_list.h"
|
||||
#include "../head/link_list.h"
|
||||
#include "../head/double_link_list.h"
|
||||
#include "../head/static_link_list.h"
|
||||
#include "../head/sequence_stack.h"
|
||||
#include "../head/share_stack.h"
|
||||
#include "../head/link_stack.h"
|
||||
|
||||
bool SequenceListTest() {
|
||||
DynamicSequenceList list;
|
||||
element_type a[6] = {'1','2','3','4','5','6'};
|
||||
list.LoopInsert(a, 0, 6);
|
||||
list.Print();
|
||||
element_type * data = list.GetData();
|
||||
element_type* b = list.LoopDelete(1, 3);
|
||||
list.Print();
|
||||
for (int i = 0; i < 3; i++) {
|
||||
@@ -32,7 +38,7 @@ bool LinkListTest() {
|
||||
auto* list = new LinkListWithoutHead();
|
||||
list->NextInsert(a, 0 ,5);
|
||||
list->Print();
|
||||
int len = 5;
|
||||
int len = 2;
|
||||
element_type* b = list->Delete(2, len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
cout << b[i] << endl;
|
||||
@@ -40,4 +46,8 @@ bool LinkListTest() {
|
||||
list->Print();
|
||||
cout << list->Locate('1') << endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StaticLinkListTest(){
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user