I have a struct node which contains a next and a child. 

```
struct Node{
Node *parent;
Node *next;
Node *child;
}

```

The following picture shows the structure of the tree.

How would I write a function that traverse that tree? without recursion ?
[![enter image description here](https://i.stack.imgur.com/paeDq.png)](https://i.stack.imgur.com/paeDq.png)

I have a pseudo code in my mind but not sure if its correct or no, because each node can have a child and I need to search using that child too

```
while ( root !=NULL)
{

root = root->next;
}

```

I would like to visit all the nodes.