Professional Documents
Culture Documents
Instructions: Assignment No. 01 Semester Fall 2019 CS301-Data Structures Total Marks: 20
Instructions: Assignment No. 01 Semester Fall 2019 CS301-Data Structures Total Marks: 20
01 Total Marks: 20
Semester Fall 2019
Due Date : 18-Nov-2019
CS301- Data Structures
Instructions
Please read the following instructions carefully before solving & submitting assignment:
It should be clear that your assignment will not get any credit (zero marks) if:
o The assignment is submitted after due date.
o The submitted code does NOT compile.
o The submitted assignment is other than .CPP file.
o The submitted assignment does NOT open or file is corrupted.
o The assignment is copied (from other student or ditto copy from handouts or internet).
Uploading instructions
For clarity and simplicity, You are required to Upload/Submit only ONE .CPP file.
o To make you familiar with implementing the Doubly Linked List data structure in C++ programming
language.
GOOD LUCK
Marks: 20
Problem Statement:
You have to implement a Double Linked List in C++ language in which you have to create a structure and two classes
as given below:
1. A structure named as “StudentDetail” by using struct keyword.
StudentDetail structure should consist of following data members of type “string”.
name
vuid
Methods Descriptions
set(X) Set the value of data in a Node.
get() Get all data values in Node
setNext(Y) Set the value of “next” data member and point to next node otherwise point to
NULL (if no next node).
getNext() Get the address of next node.
setPrev(Y) Set the value of “prev” data member and point to previous node otherwise point to
NULL (if no previous node).
getPrev() Get the address of previous node.
(“X” denotes StudentDetail variable means the student details and “Y” denotes the data value of the node).
1. addAtBegining(X): To add the node at the beginning of the doubly linked list class.
2. addAtEnd(X): To add the node at the End of the doubly linked list class.
3. delNode(): To delete a node pointed by current pointer in the doubly linked list.
1. Create two objects of type StudentDetail at the Beginning of the doubly linked list class using addATBegining
(X) method of DoublyLinkedList and use display() method to display doubly linked list.
Note that first object should contain your own VU ID and your own name otherwise you will get zero marks.
2. Create one objects of type StudentDetail at the End of the doubly linked list class using addAtEnd (X) method
of DoublyLinkedList and use display() method to display doubly linked list.
3. Delete current node of the doubly linked list and use display() method to display doubly linked list.