redblack(Node root, Node pt) :
if (root == NULL)
return pt
if (pt.data < root.data)
{
root.left = redblack(root.left, pt);
root.left.parent = root
}
else if (pt.data > root.data)
{
root.right = redblackt(root.right, pt)
root.right.parent = root
}
return root
a) insert a new node
b) delete a node
c) search a node
d) count the number of nodes
What is the below pseudo code trying to do, where pt is a node pointer and root pointer?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What is the below pseudo code trying to do, where pt is a node pointer and root pointer?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!