answersLogoWhite

0

What is your question about it?
It is quite possible, for example if it is a circular list, having a 'sentinel' node.

typedef struct ListE {
struct ListE *next;
...

} ListE;

ListE listhdr;
listhdr.next = &listhdr; /* empty list */

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What are the differences between singly-linked doubly-linked and circularly-linked lists?

The difference is how many pointers each node has, and what they are pointing to. A linked list is comprised of "Nodes" each node contains data as well as 1 or more pointers. A singly linked list has one pointer per node, and a doubly linked list has 2 pointers per node. Some programs use several pointers per node. The purpose of these pointers is to hold the list together. In a singly linked list, you can view a node and can then move on to the next node that it is pointing to until you've passed through them all. A doubly-linked list would have a pointer to the next node as well as to the previous node. Thus you can move forward and backward through the list. A circularly-linked list doesn't necessarily have a set number of pointers because it simply means that the last node points to the first node creating a big circle. A non-circularly-linked list would not contain this last to first pointer and thus you would eventually reach the end of the list and stop.


What is the minimum number of additional pointers will be needed to reverse a singly linked list?

3 pointers...


How will you represent the linked list?

With pointers pointing to the next element.


Is Linked list representation require an additional N words of memory for a list of pointers?

yes


What is null link problem in single linked list?

This is not a problem but indicates that you have reached the end of the list.


What is the real time example for double linked list?

A doubly-linked list has two pointers at minimum to refer to the previous and next item. The head of the list (the first item) has its previous item pointer set to NULL, and the tail of the list (the last item) has its next item pointer set to NULL. All other pointers point to the respective entries in the list. Keep in mind that the list itself is entirely conceptual. Unlike an array, of which each item is stored in consecutive addresses one after another, each item in an array may be located anywhere in RAM irrespective of the other items in the list. Examples of doubly-linked lists exist in many places on the Internet. A handful of samples can be found at the related links below.


Explain in detail in a binary tree of n nodes there are n plus 1 null pointers representing children?

Induction: 1. A tree of one node has two NULL-pointers. 2. Whenever you add a node to a tree, you remove one NULL-pointer (from the parent of the new node), and add two (the child's of the new node) in the same time.


How do you point to the first node in a linked list?

The list itself should maintain a pointer to the first node in the list. If it is NULL, the list is empty.


Java does not support pointers then what is null pointer exception?

A null pointer exception is thrown when you are trying to manipulate an object that is null. It is just the name and does not have any relevance to the pointers as in C Example: ArrayList lst = null; Object obj = lst.get(0); In the first line we have declared an array list. Without initializing it we have tried to access the element in the 0th position. This would cause a null pointer exception.


How do you check whether a linked list is circular?

A linked list is circular if the tail of the list points to the head. The easiest way to check this is to check whether the pointer of the tail is a null pointer. If it is, then the list is not circular.


What is the difference between linked list and Ordinary list?

A list is an abstract data structure, usually defined as an ordered collection of data. A linked list refers to a specific implementation of a list in which each element in the list is connected (linked) to the next element.


How do you know the linked list is a circular or not?

if the last node contains the address of head node instead of null then it is a circular linked llist...