Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C Programming Structure Name Bin TreeNode (typedef Binary TreeNode) Fields void* data struct _Bin TreeNode* left struct _Bin TreeNode* right Binary TreeNode* top int itemSize
C Programming
Structure Name Bin TreeNode (typedef Binary TreeNode) Fields void* data struct _Bin TreeNode* left struct _Bin TreeNode* right Binary TreeNode* top int itemSize _Binary Tree (typedef Binary Tree) Functionality The data held by this node. The left child of this node. The right child of this node. The root node of this tree. The size of the data type held by this binary tree in bytes. The name of the data type held by this binary tree as a string. A pointer to a compare function. A pointer to a print function. char* type int (*compare)(void*, void*) void (*print)(void*) Requirement Function Input Parameters Return value Notes Requirement Function Input Parameters Return value Notes Requirement Function Input Parameters Return value Notes Conditions Binary Tree* bintree_initialize(int, char*, int (*)(void*, void*), void (*)(void*)) An integer representing a type size, a char pointer representing a type name, a function pointer to a int(void*,void*) comparison function, and a function pointer to a void(void*) print function. A pointer to an initialized Binary Tree. This function should create and store a binary tree with the appropriate fields and a NULL root node. Conditions Binary TreeNode* bintree_create_node(int, void*) An integer representing a data size and a void pointer to an element. A binary tree node with null child pointers and the data set to match the element. None. Conditions bool bintree_insert(Binary Tree*, void*) A pointer to a Binary Tree and a void pointer representing an element. True if the element was inserted successfully. Otherwise false. None. Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Return Value Notes Conditions bool bintree_search(Binary Tree*, void*) A pointer to a Binary Tree and a void pointer representing an element. True if the element exists in the binary tree. Otherwise false. None. Conditions void bintree-print in order(Binary Tree*) A pointer to a Binary Tree. None. Print the binary tree following the in-order traversal requirements. Conditions void bintree-print-pre-order(Binary Tree*) A pointer to a Binary Tree. None. Print the binary tree following the pre-order traversal requirements. Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Conditions void bintree-print_post_order(Binary Tree*) A pointer to a Binary Tree. None. Print the binary tree following the post-order traversal requirements. Conditions void bintree-print_reverse_order(Binary Tree*) A pointer to a Binary Tree. None. Print the binary tree following the reverse-order traversal requirements. Conditions bool _bintree_insert_recursive(Binary Tree*, Binary TreeNode*, void*) A pointer to a Binary Tree, a pointer to a Binary TreeNode, and a void pointer representing an element. True if the function successfully inserted the element to the tree. Otherwise false. This function should be called by the bintree_insert function to aid in the recursive traversal process. This function will do the majority of the inserting. Return Value Notes Requirement Function Input Parameters Return value Notes Conditions bool _bintree_search_recursive(Binary Tree*, Binary TreeNode*, void*) A pointer to a Binary Tree, a pointer to a Binary TreeNode, and a void pointer representing an element. True if the function successfully finds the element in the tree. Otherwise false. This function should be called by the bintree_search function to aid in the recursive traversal process. This function will do the majority of the searching. Conditions void _bintree_in_order_recursive(Binary Tree*, Binary TreeNode*) A pointer to a Binary Tree and a pointer to a Binary TreeNode. None This function should be called by the bintree-print_in_order function to aid in the recursive traversal process. This function will do the majority of the traversal and will print the values accordingly. Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Return value Notes Requirement Function Input Parameters Return Value Notes Conditions void bintree-pre-order_recursive(Binary Tree*, Binary TreeNode*) A pointer to a Binary Tree and a pointer to a Binary TreeNode. None This function should be called by the bintree-print_pre_order function to aid in the recursive traversal process. This function will do the majority of the traversal and will print the values accordingly. Conditions void _bintree-post_order_recursive(Binary Tree*, Binary TreeNode*) A pointer to a Binary Tree and a pointer to a Binary TreeNode. None This function should be called by the bintree-print_post_order function to aid in the recursive traversal process. This function will do the majority of the traversal and will print the values accordingly. Conditions void _bintree_reverse_order_recursive(Binary Tree*, Binary TreeNode*) A pointer to a Binary Tree and a pointer to a Binary TreeNode. None This function should be called by the bintree-print_reverse_order function to aid in the recursive traversal process. This function will do the majority of the traversal and will print the values accordingly. Requirement Function Input Parameters Return Value Notes Structure Name Bin TreeNode (typedef Binary TreeNode) Fields void* data struct _Bin TreeNode* left struct _Bin TreeNode* right Binary TreeNode* top int itemSize _Binary Tree (typedef Binary Tree) Functionality The data held by this node. The left child of this node. The right child of this node. The root node of this tree. The size of the data type held by this binary tree in bytes. The name of the data type held by this binary tree as a string. A pointer to a compare function. A pointer to a print function. char* type int (*compare)(void*, void*) void (*print)(void*) Requirement Function Input Parameters Return value Notes Requirement Function Input Parameters Return value Notes Requirement Function Input Parameters Return value Notes Conditions Binary Tree* bintree_initialize(int, char*, int (*)(void*, void*), void (*)(void*)) An integer representing a type size, a char pointer representing a type name, a function pointer to a int(void*,void*) comparison function, and a function pointer to a void(void*) print function. A pointer to an initialized Binary Tree. This function should create and store a binary tree with the appropriate fields and a NULL root node. Conditions Binary TreeNode* bintree_create_node(int, void*) An integer representing a data size and a void pointer to an element. A binary tree node with null child pointers and the data set to match the element. None. Conditions bool bintree_insert(Binary Tree*, void*) A pointer to a Binary Tree and a void pointer representing an element. True if the element was inserted successfully. Otherwise false. None. Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Return Value Notes Conditions bool bintree_search(Binary Tree*, void*) A pointer to a Binary Tree and a void pointer representing an element. True if the element exists in the binary tree. Otherwise false. None. Conditions void bintree-print in order(Binary Tree*) A pointer to a Binary Tree. None. Print the binary tree following the in-order traversal requirements. Conditions void bintree-print-pre-order(Binary Tree*) A pointer to a Binary Tree. None. Print the binary tree following the pre-order traversal requirements. Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Conditions void bintree-print_post_order(Binary Tree*) A pointer to a Binary Tree. None. Print the binary tree following the post-order traversal requirements. Conditions void bintree-print_reverse_order(Binary Tree*) A pointer to a Binary Tree. None. Print the binary tree following the reverse-order traversal requirements. Conditions bool _bintree_insert_recursive(Binary Tree*, Binary TreeNode*, void*) A pointer to a Binary Tree, a pointer to a Binary TreeNode, and a void pointer representing an element. True if the function successfully inserted the element to the tree. Otherwise false. This function should be called by the bintree_insert function to aid in the recursive traversal process. This function will do the majority of the inserting. Return Value Notes Requirement Function Input Parameters Return value Notes Conditions bool _bintree_search_recursive(Binary Tree*, Binary TreeNode*, void*) A pointer to a Binary Tree, a pointer to a Binary TreeNode, and a void pointer representing an element. True if the function successfully finds the element in the tree. Otherwise false. This function should be called by the bintree_search function to aid in the recursive traversal process. This function will do the majority of the searching. Conditions void _bintree_in_order_recursive(Binary Tree*, Binary TreeNode*) A pointer to a Binary Tree and a pointer to a Binary TreeNode. None This function should be called by the bintree-print_in_order function to aid in the recursive traversal process. This function will do the majority of the traversal and will print the values accordingly. Requirement Function Input Parameters Return Value Notes Requirement Function Input Parameters Return value Notes Requirement Function Input Parameters Return Value Notes Conditions void bintree-pre-order_recursive(Binary Tree*, Binary TreeNode*) A pointer to a Binary Tree and a pointer to a Binary TreeNode. None This function should be called by the bintree-print_pre_order function to aid in the recursive traversal process. This function will do the majority of the traversal and will print the values accordingly. Conditions void _bintree-post_order_recursive(Binary Tree*, Binary TreeNode*) A pointer to a Binary Tree and a pointer to a Binary TreeNode. None This function should be called by the bintree-print_post_order function to aid in the recursive traversal process. This function will do the majority of the traversal and will print the values accordingly. Conditions void _bintree_reverse_order_recursive(Binary Tree*, Binary TreeNode*) A pointer to a Binary Tree and a pointer to a Binary TreeNode. None This function should be called by the bintree-print_reverse_order function to aid in the recursive traversal process. This function will do the majority of the traversal and will print the values accordingly. Requirement Function Input Parameters Return Value Notes
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started