All... 썸네일형 리스트형 1. 순차보관 class App { //Stu * arr[10]; MyVector arr; } void App::Insert() { Stu *s; ... //학생 개체 생성 arr.PushBack(s); } App::Search(int num) { ..... Stu *s = FindAtArr(arr.Begin(), arr.End(), num); if(s==arr.End()) { //못찾았다. return; } //찾았다 } App::Delete() { ... Stu **s = FindAtArr(arr.Begin(), arr.End(), num); if(s==arr.End()) { //못찾았다 return; } //찾았다 arr.Erase(); } Stu * App::FindAtArr(int num) { Stu *s; .. 더보기 3. Hash Function에 의해 자료를 보관 App::App() { arr.ExtendStorage(MAX_STU); } template void MyVector::reserve(int _capa) { ExtendStorage(_capa); } App::InitCatamer() { arr.ExtendStorage(MAX_STU): Stu **seek = arr.Begin(); Stu **end = arr.End(); for( ;seek!= end; ++seek) { (*seek)=0; } } App:Insert { Stu *s = ; ... //학생 개체 생성 int index=0; index = HashFun(s); arr[index] = s; } App::Serch() { //검색할 키 입력 index = HashFun(key); //index.. 더보기 2. 특정 키순으로 보관(complete) App::App() { //초기화가 필수사항은 아니다. } void App::Insert() { Stu *s; ... //자료를 보관할 위치를 찾는다. //찾은 위치에 자료를 보관 └ arr.Insert(seek, s); } void App::Delete() { Stu *s; //순차보관과 다를 바 없3 } 더보기 이전 1 ··· 29 30 31 32 33 34 다음