What is the below pseudo code trying to do, where pt is a node pointer and root pointer? [code] redblack(Node root, Node pt) : if

What is the below pseudo code trying to do, where pt is a node pointer and root pointer?
Code:
  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
 

Tìm kiếm

Back
Top