966 views
1 votes
1 votes
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 at last node while some given only last pointer and some have only first pointer

1 Answer

0 votes
0 votes

if we take *last as a pointer pointing to the last node of the list then  we can point to the start node in o(1) by 

Node *start=last->next;

and can do any thing that we can doing using the start as a pointer  ,that's simple

so its your choice but we can achieve it using one pointer only

but i will suggest u to use last, because insertion at beginning and deletion at the beginning will cost u o(n) if u use start 

because u will have to traverse all the list to find the last node so that after the insertion or the deletion option u can update the links.

Related questions

0 votes
0 votes
1 answer
1
kd..... asked Feb 9, 2018
2,024 views
the sorage requirements of a linked stack with n elements will be what