I was asked in a interview about the difference between node structures of Doubly linked list and binary Tree.
Doubly Linked List Struct
typedef struct
{
int data;
struct node * next;
struct node * prev;
}node;
Binary Tree Struct
typedef struct
{
int data;
struct node * left;
struct node * right;
}node;
- In Doubly linked list, we use pointers for traversing back and front in a linearly arranged list.
- But where as left & right pointers are used to access the left & right nodes.
I don't find any difference in node structure except the way they are used. Could you please give me some differences???