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

Data Structures and Algorithm

University of Engineering and Technology


Taxila-Electrical Engineering Department

LAB #: 9 (Two-Way Linked list)


Program #1: Write a program that declares a structure named as node to store number.

The program should define structure variable and 2 pointers to node.


struct node
{
int data;
node * next;
node * prev;
};
Create a 2-way linked list which has a menu as:
a) Press 1 to add data at the start of list.
b) Press 2 to add data at the end of list.
c) Press 3 to add data at the middle of list.
d) Press 4 to display the sum of existing numbers.
e) Press 5 to show the existing list.
f) Press 6 to Exit the program.

Data Structures and Algorithm

Note:

Code should be hand written and it should be neat and clean.

Output of every program should be display in front of its code.

Your Name, Roll_no and Group should mention on the top of every program.

Copied task will be marked cancel.

Submit your practical book at the start of lab.

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