Hi

Is this circular linked list ? if not How it can be circular linked list ?

Code:
```#include<stdio.h>

#include<stdlib.h>

struct Node{
int X;
struct Node *Next;
};

struct Node* New_Node(int Number, struct Node *next) {
struct Node *New = malloc(sizeof(*New));
New -> X = Number;
New -> Next = next;
return New;
}

int main (void ) {

return 0;
}``` 2. For it to be Circular the new node needs to have the node before pointing to it.
Note: I am far from being a expert of Circular link lists.

Tim S. 3. Originally Posted by stahta01 For it to be Circular the new node needs to have the node before pointing to it.
Note: I am far from being a expert of Circular link lists.

Tim S.
Can you describe little bit ? perhaps pseudo code will help a lot 4. For a list to be circular, you have to be able to start as some point P, and follow the list in a single direction, and eventually end up back at the very same point P.

Your example code is not circular.

To make it circular, follow the next pointers until you end up almost back at the start, and then insert the new node.

Code:
```HEAD --> 11 --> 12 --> 13 -+
^                |
|                |
+----------------+``` 5. Originally Posted by aghast For a list to be circular, you have to be able to start as some point P, and follow the list in a single direction, and eventually end up back at the very same point P.

Your example code is not circular.

To make it circular, follow the next pointers until you end up almost back at the start, and then insert the new node.

Code:
```HEAD --> 11 --> 12 --> 13 -+
^                |
|                |
+----------------+```
Can you give pseudo code for function ? or algorithm for function 6. Can you give pseudo code for function ? or algorithm for function
I already did: to make it circular, follow the next pointers until you are almost back where you started. Then insert your new value.

Start with the simple case: how do you insert a single new node into a list where head is NULL?

Here are some rules:

1. When you call a list function, you pass in the "head" pointer as a pointer.
2. When a function updates the list, it always returns a new value for the "head" pointer, even if that doesn't change. The caller has to take the update.
3. When you return from a "public API" function, the list is always circular or the head pointer is NULL.

So:

Code:
```    struct Node *
insert_new_node_into_empty_list(struct Node * head, NodeValueT value)
{
assert( head == NULL ); // otherwise it's not an empty list

// ... code goes here ...
}``` Popular pages Recent additions circular, head, head;, node, struct 