Convert into JAVA #include <time.h> /* Node in a binary search tree */ struct Tr
ID: 3581330 • Letter: C
Question
Convert into JAVA
#include <time.h>
/* Node in a binary search tree */
struct TreeNode {
void *key;
struct TreeNode *parent;
struct TreeNode *left;
struct TreeNode *right;
};
struct Tree {
struct TreeNode *root;
};
/* Find the height of the subtree rooted at x */
int maxDepth(TreeNode *x);
/* Print the elements of the tree in ascending order */
void inorderTreeWalk(TreeNode *x, void ( *action )( void *));
/* Pointer to node with the smallest key in a subtree rooted at x */
TreeNode* treeMinimum(TreeNode *x);
/* Pointer to node with the largest key of a subtree rooted at x */
TreeNode* treeMaximum(TreeNode *x);
/* Insert a node into the tree */
void treeInsert(Tree* t, TreeNode *z, int ( *compare )( void *, void * ));
/* Find a node with the matching key value in a given node's subtree */
TreeNode* treeSearch(TreeNode *x, void *k, int ( *compare )( void *, void *));
/* Replace a node u with a node v */
void transplant(Tree *t, TreeNode *u, TreeNode *v);
/* Delete a node z from the tree */
void treeDelete(Tree* t, TreeNode* z);
#endif
Explanation / Answer
I will edit the answer with the complete code in java for you. please wait till then. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.