Sie sind auf Seite 1von 6

CSC248 – FUNDAMENTALS OF DATA STRUCTURES

LINKED LIST: TUTORIAL 1

NAME : NURUL AINNI BINTI SAMSI


STUDENT : 2018434122
NO.
GROUP : RCS1104B

PART A
Shades the best answer.

1. Which of the following is NOT a type of linked list?

Circular linked list Doubly linked list Singly linked list Hybrid linked list

2. Each node in a linked list contains a minimum of two fields, one field is
called data field; to store data and another field is a _____.

pointer to an pointer to a
pointer to a node pointer to a class
integer character

3. Given the following diagram:

12 55 2 11

This diagram shows a _____.

Reversed linked
Circular linked list Doubly linked list Singly linked list
list

4. When user creates a reference to a linked list, it _____.

must refer to the must refer to the


must refer to the can refer to any
link pointed by link pointed by
first link link user wants
current node the next node

PART B

Listed in the given table are the nodes in a linked list name ‘Beautiful’:

Name of the Address of the Data of the Next address


node node node
Makeup_1 P0087L Lipstick K5467P
Makeup_2 K5467P Blusher L3217M
Makeup_3 L3217M Mascara P1237B
Makeup_4 P1237B Brush G7804H
Makeup_5 G7804H Eyeliner W3426M
Makeup_6 W3426M Foundation NULL

a) Draw the initial diagram of ‘Beautiful’.


b) Remove the node named ‘Makeup_4’ from ‘Beautiful’.
c) Make the node given in table below as the last node of ‘Beautiful’:

Name of the Address of the Data of the Next address

PREPARED BY: NYCJ @ FSKM, UiTM CAWANGAN PERLIS KAMPUS ARAU


CSC248 – FUNDAMENTALS OF DATA STRUCTURES
LINKED LIST: TUTORIAL 1

node node node


Makeup_7 P1007L Primer NULL

d) Insert the given node below between node named ‘Makeup_2’ and
‘Makeup_3’:

Name of the Address of the Data of the Next address


node node node
Makeup_8 M0007J Bronzer

e) Draw the final diagram for ‘Beautiful’.

*Show clearly all the steps involved.

a) Draw the initial diagram of ‘Beautiful’.

P0087L K5467P

P0087L LIPSTIC K5467 BLUSHE L3217


K P R M

PREPARED BY: NYCJ @ FSKM, UiTM CAWANGAN PERLIS KAMPUS ARAU


CSC248 – FUNDAMENTALS OF DATA STRUCTURES
LINKED LIST: TUTORIAL 1

Makeup_1 Makeup_2

G7804H P1237B L3217M


EYELINE W3426 BRUSH G7804 MASCARA P1237
R M H B

Makeup_5 Makeup_4 Makeup_3

W3426M
FOUNDATIO X
N
Makeup_6

b) Remove the node named ‘Makeup_4’ from ‘Beautiful’.

P0087L K5467P

P0087L LIPSTIC K5467 BLUSHE L3217


K P R M Makeup_1
Makeup_2

PREPARED BY: NYCJ @ FSKM, UiTM CAWANGAN PERLIS KAMPUS ARAU


CSC248 – FUNDAMENTALS OF DATA STRUCTURES
LINKED LIST: TUTORIAL 1

G7804H L3217M
EYELINE W3426 MASCARA G7804
R M H

Makeup_5 Makeup_3

W3426M
FOUNDATIO X
N
Makeup_6

c) Make the node given in table below as the last node of ‘Beautiful’:

P0087L K5467P

P0087L LIPSTIC K5467 BLUSHE L3217


K P R M Makeup_1
Makeup_2

G7804H L3217M
EYELINE W3426 MASCARA G7804
R M H

Makeup_5 Makeup_3

W3426M P1007L
FOUNDATIO P1007 PRIMER X
N L
Makeup_6 Makeup_7

d) Insert the given node below between node named ‘Makeup_2’ and
‘Makeup_3’:

P0087L K5467P

P0087L
PREPARED BY: NYCJ @ FSKM, UiTM CAWANGAN PERLIS KAMPUS ARAU
CSC248 – FUNDAMENTALS OF DATA STRUCTURES
LINKED LIST: TUTORIAL 1

LIPSTIC K5467 BLUSHE L3217


K P R M Makeup_1
Makeup_2

G7804H L3217M
EYELINE W3426 MASCARA G7804
R M H

Makeup_5 Makeup_3

W3426M P1007L
FOUNDATIO P1007 PRIMER X
N L
Makeup_6 Makeup_7

P0087L K5467P

P0087L LIPSTIC K5467 BLUSHE M0007J


K P R Makeup_1
Makeup_2
M0007J
BRONZE L3217
R M
Makeup_8
G7804H L3217M
EYELINE W3426 MASCARA G7804
R M h

Makeup_5 Makeup_3

W3426M P1007L
FOUNDATIO P1007 PRIMER X
N L
Makeup_6 Makeup_7

e) Draw the final diagram for ‘Beautiful’.

P0087L K5467P

P0087L
PREPARED BY: NYCJ @ FSKM, UiTM CAWANGAN PERLIS KAMPUS ARAU
CSC248 – FUNDAMENTALS OF DATA STRUCTURES
LINKED LIST: TUTORIAL 1

LIPSTIC K5467 BLUSHE L3217


K P R M Makeup_1
Makeup_2
M0007J
BRONZE M0007J
R
Makeup_8
G7804H L3217M
EYELINE W3426 MASCARA G7804
R M h

Makeup_5 Makeup_3

W3426M P1007L
FOUNDATIO P1007 PRIMER X
N L
Makeup_6 Makeup_7

PREPARED BY: NYCJ @ FSKM, UiTM CAWANGAN PERLIS KAMPUS ARAU

Das könnte Ihnen auch gefallen