2,020 views

1 Answer

0 votes
0 votes
Now we have a linked list containing n elements. Assuming it is singly linked list, for n elements we need n nodes right? now let us focus on 1 node.

1 node will consist of a value and a pointer to next node.

So total requirement of space for 1st node is ( size of memory needed for storing that value (Let it be x) + size of pointer(let it be y)).

THEREFORE TOTAL SPACE REQUIRED IS=NO OF NODES*SIZE OF EACH NODE=N(X+Y).

Related questions

1 votes
1 votes
1 answer
1
kd..... asked Dec 30, 2017
961 views
In a circular single linked list how many external pointers are there because in some books there are two external pointers start pointing at first node and last pointing...