1
0
mirror of https://github.com/Didnelpsun/CS408.git synced 2026-02-07 21:04:38 +08:00

更新内存管理

This commit is contained in:
Didnelpsun
2021-08-24 23:55:13 +08:00
parent c3d4acdf8f
commit 61a0b89de7
4 changed files with 250 additions and 97 deletions

View File

@@ -19,17 +19,21 @@ int SequenceListTest() {
}
int LinkListTest() {
LinkListWithHead list;
//cout << list.Empty() << endl;
element_type a[6] = { '1','2','3','4','5','6' };
list.NextInsert(a, 0, 5);
list.Print();
list.Delete(2, 3);
list.Print();
element_type a[6] = {'0', '1','2','3','4','5' };
// LinkListWithHead list;
// list.NextInsert(a, 0, 5);
// list.Print();
// list.Delete(2, 4);
// list.Print();
/*cout << list.GetLength() << endl;
LinkListWithoutHead list2;
list2.PriorInsert(a, 2, 3);
list2.Print();
cout << list2.GetLength() << endl;*/
auto* list = new LinkListWithoutHead();
list->NextInsert(a, 0 ,5);
list->Print();
list->Delete(2,4);
list->Print();
return 0;
}