I'm still not entirely sure what that means. Does it mean you recursively swap left and right branches, or does it mean you create a new data structure where the bottom elements become the top elements?
struct node {
struct node *left_node;
struct node *right_node;
int val;
};
struct reversed_node {
struct reversed_node *right_node;
struct reversed_node *left_node;
int val;
};
No? You then just have a different mapping for the exact same data, no traversal needed.