The Gateway to Computer Science Excellence
+1 vote
163 views

In a circular linked list last node points to the :

  1. $Head$
  2. $Tail$
  3. $First Node$
in Programming by (209 points)
edited by | 163 views
+1
first node

1 Answer

+6 votes
Best answer

Each node in a circularly linked list has a next pointer and a reference to an element.

In a circular linked list, the last element stores the address of the starting element.

Instead of having the last node's next pointer be null, in a circularly linked list, it points back to the first node.

Circular linked lists can be used to help the traverse the same list again and again if needed.

In a circular linked list there are two methods to know if a node is the first node or not.

  •  Either an external pointer, list, points to the first node or 
  • A header node is placed as the first node of the circular list. (header node can be separated from the others by having a dedicated flag variable to specify if the node is a header node or not.) 

The answer will be last node points to the first node of the list.

by Boss (17.7k points)
selected by
0
Why not Head node @SubarnaDas
+2

1.Head can be a different pointer which points to the first node of the LL. 
2.Head can be the $1^{st}$ node of the LL

@Subarna ...because of point 1, head is not the appropriate answer. Am I right ?

+1

exactly,  Soumya :)

0
head pointer only point first node ,head is a just pionter ,head dont contain any data so it will not consider as a element of LL so last pointer as well as head both are point first node so answer is  first node
0
Can you please explain the concept of Sentinal???(In Circular Linked List)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,492 answers
195,439 comments
100,696 users