Вы находитесь на странице: 1из 2

MTS 3023: DATA STRUCTURES

SEMESTER 2 SESI 2018/2019


ASSIGNMENT 2

Answer ALL of the questions below:

1. Please modify the linked list program provided to produce the


sample of output is as below:

Sample of Output:

Please enter a new value to be inserted : 3


Please enter a new value to be inserted : 18
Please enter a new value to be inserted : 5
Please enter a new value to be inserted : 7
Please enter a new value to be inserted : 23

**Display list**
3 18 5 7 23

Please enter a data to be removed : 3

**Display list**
18 5 7 23

Please enter a data to be removed : 15


Sorry we cannot remove the data as it is not in the list

Please enter a data that you want to find : 23


Yes, the data is found!

Reversed list
23 7 5 18

Sorted list
5 7 18 23

Reversed list
23 18 7 5

**Delete list**

**Display list**
Sorry the list is empty

Hints: Please create the reversed list function.


Instructions:
1. This is an individual assignment.
2. Assignment only be submitted in hardcopy.
3. Detail on the front cover of your assignment are:
a. Name
b. Matric Number
c. Lecture group
4. Due date: Week 9

Вам также может понравиться