hii , I'll appreciate it if someone please help me with this problem
I want to create a linked-list from the leaves of a tree ordered from right to left .
without using a Static or global variable
typedef struct t_node {
int data;
struct t_node *left;
struct t_node *right;
} T_NODE;
typedef struct list_node
{
int data;
struct list_node *next;
} L_NODE;
the function header : L_NODE* leavesRightToLeft (T_NODE* root, 1 more variable )
for example :
Code:
3
/ \
2 5
\ / \
4 7 9
/
1
and the function will return a pointer to linked list that will be as following :
1 -> 7 -> 4