91.
What does the following piece of code do?
public void func(Tree root)
{
	System.out.println(root.data());
	func(root.left());
	func(root.right());
}

92.
What are the operations that could be performed in O(logn) time complexity by red-black tree?

93.
In general, the node content in a threaded binary tree is . . . . . . . .

95.
Given that 2 elements are present in the tree, write a function to find the LCA(Least Common Ancestor) of the 2 elements.

public void lca(Tree root,int n1, int n2)
{
	while (root != NULL)
        {
            if (root.data() > n1 && root.data() > n2)
            root = root.right();
            else if (root.data() < n1 && root.data() < n2)
            root = root.left();
	    else break;
        }
        System.out.println(root.data());
}

public void lca(Tree root,int n1, int n2)
{
    while (root != NULL)
    {
        if (root.data() > n1 && root.data() < n2)
        root = root.left();
        else if (root.data() < n1 && root.data() > n2)
        root = root.right();
	else break;
    }
    System.out.println(root.data());
}

public void lca(Tree root,int n1, int n2)
{
    while (root != NULL)
    {
        if (root.data() > n1 && root.data() > n2)
        root = root.left();
        else if (root.data() < n1 && root.data() < n2)
        root = root.right();
	else break;
    }
    System.out.println(root.data());
}

public void lca(Tree root,int n1, int n2)
{
    while (root != NULL)
    {
        if (root.data() > n1 && root.data() > n2)
        root = root.left.left();
        else if (root.data() < n1 && root.data() < n2)
        root = root.right.right();
	else break;
    }
    System.out.println(root.data());
}

98.
What happens if we apply the below operations on an input sequence?
i. construct a cartesian tree for input sequence
ii. put the root element of above tree in a priority queue
iii. if( priority queue is not empty) then
iv. search and delete minimum value in priority queue
v. add that to output
vi. add cartesian tree children of above node to priority queue

Read More Section(Binary Search Trees(B Tree))

Each Section contains maximum 100 MCQs question on Binary Search Trees(B Tree). To get more questions visit other sections.