0% found this document useful (0 votes)
67 views

Course Code: F4104 Course Name: Algorithm & Data Structure Assignment: 2 Date: Title: List and Linked List

The document provides instructions for an assignment on lists and linked lists. It asks students to define lists and linked lists, sketch diagrams showing changes to lists after deleting an element, list basic operations for lists, describe the parts of linked list nodes, compare lists and linked lists, write a node declaration for a linked list with 3 fields, write declarations for pointers in a linked list diagram and sketch changes based on operations, write a linked list declaration based on a sample diagram, write code to insert a node at the front of a linked list, and write code for delete operations on a linked list based on before and after diagrams. It provides sample diagrams and questions to help students complete the assignment.

Uploaded by

Md Rodi Bidin
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Course Code: F4104 Course Name: Algorithm & Data Structure Assignment: 2 Date: Title: List and Linked List

The document provides instructions for an assignment on lists and linked lists. It asks students to define lists and linked lists, sketch diagrams showing changes to lists after deleting an element, list basic operations for lists, describe the parts of linked list nodes, compare lists and linked lists, write a node declaration for a linked list with 3 fields, write declarations for pointers in a linked list diagram and sketch changes based on operations, write a linked list declaration based on a sample diagram, write code to insert a node at the front of a linked list, and write code for delete operations on a linked list based on before and after diagrams. It provides sample diagrams and questions to help students complete the assignment.

Uploaded by

Md Rodi Bidin
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Course Code : F4104 Assignment : 2

Course Name : Date :

ALGORITHM & DATA STRUCTURE

Title : List and Linked List

INSTRUCTION: ANSWER ALL QUESTION

1. Gives definition for list and linked list. 2. Let say, we want to delete D. Sketch the diagram of list to show the changes.
[0] H [1] G [2] F [3] [4] E D [5] [6] C B [7] A

3. List down the basic operation that can be done towards a list. 4. Each node in linked list is divided into 2 parts. State the parts for each node.
5. Gives the differences between list and linked list.

6. Write down the node declaration for a linked list that consists of 3 fields; name, marks and pointer that point to next
node.

7. Based on the diagram below 16 23

a) Gives declaration for pointer p and q that point to a node in a linked list. b) Sketch a diagram to show changes based on the statement given. i. ii. iii. iv. v.
p p p p p = p -> link; -> link -> link = p; -> link = p; -> data = q -> data; = NULL;

[email protected]

8. Based on the diagram given, state the declaration for a linked list. Zukia 21 Syahieda 19 Suzana 20

9.

Write down code statement to show an operation for inserting node in-front of the linked list based on the diagram given. C D E

x y

B A

Before x B C D E

A After

10. Given are the diagram before and after for delete operation towards a node in linked list. Write down code
statement for (a), (b) and (c) as shown in the diagram given. x 2 7 14 23

Before

y (a)

14 (b)

23

(c)

x After

23

[email protected]

You might also like