Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Write C Programs Treeh Treec A7q1c Create Operate Test Binary Tree Data Structure Treeh Tr Q35551536

Write C programs tree.h, tree.c anda7q1.c to create, operate and test binary a treedata structure.

tree.h and tree.c contain the following data type definition,function prototypes and implementations.

  1. design and implement a general binary tree data structure withthe following features.

typedef struct tree_node { int data; struct tree_node *left; struct tree_node *right;} TNODE;/* creates a TNODE node and sets the data to value and returns the pointer */TNODE *new_node(int value);/* this computes and returns the number of node count of the tree passed by root.*/int get_count(TNODE *root);/* this computes and returns the number of the tree passed by root. */int get_height(TNODE *root);/* this cleans the tree passed by rootp. */void clean_tree(TNODE **rootp);/* this displays the node data of the tree by pre-order. */void display_preorder(TNODE *root);/* this displays the node data of the tree by in-order. */void display_inorder(TNODE *root);/* this displays the node data of the tree by post-order. */void display_postorder(TNODE *root);/* this displays the tree in 2D text format */void display_tree(TNODE *root, int prelen);/* this displays the tree in breadth-first order using additional queue data structure */void iterative_bf_display(TNODE *root);/* this does the breadth-first search */TNODE *iterative_bf_search(TNODE *root, int val);/* this does the depth-first search */TNODE *iterative_df_search(TNODE *root, int val);

I just need help implementing the code above

Leave a Reply

Your email address will not be published. Required fields are marked *