Question: Singly Linked List ADT In this homework, you will complete the implementation of Doubly Linked List data structure. The following functions have been implemented in

Singly Linked List ADT
In this homework, you will complete the implementation of Doubly Linked List
data structure. The following functions have been implemented in
SinglyLinkedList.cpp.
get (int position)- It returns an element at a given position.
printList ()- It prints the list on the console.
removeElement (int position)- It removes an element at a given position.
insertLast (int newElement)- It inserts a new element at the end of the List.
sizeList ()- It returns the size of the given List.
main ()- It runs and tests the program (functions).
Your job is to modify or create the functions above to design a fully
functional DoublyLinked List data structure.struct Node {
int element;
struct Node *next;
struct Node*prev;
}
In this homework, you will complete the implementation of Doubly Linked List
data structure.
get (int position)- It returns an element at a given position. This function can
use head or tail pointer for traversing the list. Your code should decide whether
tail or head pointer will be used to traverse the list.
printList (struct Node *pointer)- It prints the given list on the console. Your
function must be able to print from head or tail. Again, your code should decide
whether the pointer is tail or head.
removeEle (int position)- It removes an element at a given position. This
function can use head or tail pointer for traversing the list. Your code should
decide whether tail or head pointer will be used to traverse the list.
insertLast (int newElement)- It inserts a new element at the end of the
List.sizeList ()- It returns the size of the given List.
reverseList ()- It reverses the given list.
main ()- It runs and tests the program (functions).Points for Homework-3
Singly Linked List ADT In this homework, you will

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!