Skip to content

fajarrivaldy22/ASD_Task_3

 
 

Repository files navigation

Task_3 [2017/2018-II]

Task 3 : Linked List Introduction

DEADLINE = FEBRUARY 14TH, 2018 - 23:59

Reading Material

Workflow

  1. FORK this repositori ASD_Task_3 to your GitHub account
  2. CLONE ASD_Task_3 repository from YOUR OWN ACCOUNT
  3. open and modify codes in *.cpp and *.h files inside project ASD_Task_3
  4. write your code inside the provided space in each functions/procedures
  5. COMMIT and PUSH your project to your account
  6. create a Pull Request

Create a program to store and manage a data using single linear linked list

TO DO

mydata.h (From Previous Task_2)

TODO: create a new Data type with specification: - an integer variable acted as an ID - two other variables - a float variable

mydata.cpp

  • mytype create_data()
    TODO: receive input from user and assign the value of new data
  • view_data(mytype d)
    TODO: view the content of data d
  • edit_data(mytype &d)
    TODO: edit the value of data d, the ID must not be modified

You may just copy your previous result

list.h

Create ADT of single linked list

  • define a function and a procedure to allocate and deallocate an element list

    • function allocate(in: x : infotype) : address
    • procedure 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: 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: Prec : address, i/o: P : address )
  • define search-by-ID function and view procedure

    • function findElm( i: L : List, x : infotype ) : address
    • procedure viewList( i: L : List )

operation.h

  • 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 )

list.cpp

Implement function and procedure defined in list.h

operation.cpp

Implement function and procedure defined in operation.h

main.cpp

Create a main menu to run your application
Menu Application:

  1. insert new data
  2. print all data
  3. find and print a data by ID
  4. edit data by ID
  5. delete data by ID
  6. exit

CRITERIA

ID is unique, check whether ID is already exsits when inserting new element

About

Linked List Introduction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%