Linked list doubt

When we have a linked list named a.
when do we use a==NULL
and when do we use a->next==NULL
?

Hey @prerna_gupta31
a==NULL is used to check if current node is allocated or not
Similarlly a->next==NULL is used to check if next node is allocated or not

And

There is nothing like linked list named a
I think u meant Linked list whose starting node is pointed by a .
Linked list is collection of node class object connected using next pointers

Thankyou for clarifying

1 Like

so basically when we say a, we refer to the head… right?

correct, pointer pointing to 1st node of our list .