Forum Discussion on linked list(Week-4)

Answer to the questions

Answer to the questions

by Ahmed Ishtiak Nihal -
Number of replies: 0

Answer to the question no(1)

We know that if we want to add a new node at the end of a linked list, we have to add a new node through the last insert. I also know that the address part of the last node in a linked list is null.
Now if I want to insert a new node at the end of the linked list, I first need to create a new node and insert data into the node. Then with the newly created node, you have to link the last node with the null of the existing linked list and null the address part of the new node.
Then a new node will be added as the last node at the end of the linked list and null will be assigned to the address part.

Answer to the question no (2)

There are three types of Linked List.
1.Singly Linked List
2.Doubly Linked List
3.Circular Linked List

Answer to the question no (3)

Some of the drawbacks in the linked list are mentioned below:
1) It requires more space as pointers are also stored with information.
2) Different amount of time is required to access each element.
3) If we have to go to a particular element then we have to go through all those elements that come before that element.
4) we can not traverse it from last & only from the beginning.
5) It is not easy to sort the elements stored in the linear linked list.