Task 4 : Double Linked List Introduction
- FORK this repositori ASD_Task_4 to your GitHub account
- CLONE ASD_Task_4 repository from YOUR OWN ACCOUNT
- open and modify codes in *.cpp and *.h files inside project ASD_Task_4
- write your code inside the provided space in each functions/procedures
- COMMIT and PUSH your project to your account
- create a Pull Request
Create a program to store and manage a data using Double linear linked list
[SHOULD YOU HAVE ALREADY DONE TASK 3, THEN YOU JUST HAVE TO COPY-PASTE YOUR CODES AND MODIFY SOME OF THEM ]
TODO: create a new Data type with specification: - an integer variable acted as an ID - two other variables - a float variable
TODO: create a new Data type, DIFFERENT FROM THE FIRST ONE with specification: - an integer variable acted as an ID - two other variables
mytype create_data()
TODO: receive input from user and assign the value of new dataview_data(mytype d)
TODO: view the content of data dedit_data(mytype &d)
TODO: edit the value of data d, the ID must not be modified
mytype2 create_data()
TODO: receive input from user and assign the value of new dataview_data(mytype2 d)
TODO: view the content of data dedit_data(mytype2 &d)
TODO: edit the value of data d, the ID must not be modified
You may just copy your previous result
Create ADT of single linked list
-
define a function and a procedure to allocate and deallocate an element list
function allocate(in: x : infotype) : addressprocedure deallocate( i/o: P : address )
-
define insert and delete procedure
procedure insertFirst( i/o: L : List, i: P : address )procedure insertLast( i/o: L : List, i: P : address )procedure insertAfter( i/o: L : List,i: Prec : address, P : address )procedure deleteFirst( i/o: L : List, i/o: P : address )procedure deleteLast( i/o: L : List, i/o: P : address )procedure deleteAfter( i/o: L : List,i: Prec : address, i/o: P : address )
-
define search-by-ID function and view procedure
function findElm( i: L : List, x : infotype ) : addressprocedure viewList( i: L : List )
- define insertion procedure
procedure insertionSort( i: L : List )
TODO: insert an element pointed by P into an already sorted-by-ID List L,
so that the elements inside List L is still sorted by ID
procedure must also check if such ID is already exists (No Duplicate ID)
- define deletebyID function
procedure deletebyID( i/o : L : List, x : infotype )
Implement function and procedure defined in list.h
Implement function and procedure defined in operation.h
Create a main menu to run your application
Menu Application:
- insert new data
- print all data
- find and print a data by ID
- edit data by ID
- delete data by ID
- exit
- ID is unique, check whether ID is already exsits when inserting new element
- try to change the infotype in
doublelist.hfrommytypeintomytype2