What is a splay operation?
A. moving parent node to down of child
B. moving a node to root
C. moving root to leaf
D. removing leaf node
Select an option to see the answer and solution.
The following given tree is an example for?
A. Binary tree
B. Binary search tree
C. Fibonacci tree
D. AVL tree
Select an option to see the answer and solution.
The steps for finding post-order traversal are traverse the right subtree, traverse the left subtree or visit the current node.
Select an option to see the answer and solution.
Binary tree sort implemented using a self balancing binary search tree takes O(n log n) time in the worst case but still it is slower than merge sort.
Select an option to see the answer and solution.
What operation does the following diagram depict?
A. inserting a leaf node
B. inserting an internal node
C. deleting a node with 0 or 1 child
D. deleting a node with 2 children
Select an option to see the answer and solution.
What is the possible number of binary trees that can be created with 3 nodes, giving the sequence N, M, L when traversed in post-order.
Select an option to see the answer and solution.
The size value of various nodes in a weight balanced tree are
leaf - zero
internal node - size of it's two children
is this true?
Select an option to see the answer and solution.
Why is heap implemented using array representations than tree(linked list) representations though both tree representations and heaps have same complexities?
for binary heap
-insert: O(log n)
-delete min: O(log n)
for a tree
-insert: O(log n)
-delete: O(log n)
Then why go with array representation when both are having same values ?
A. arrays can store trees which are complete and heaps are not complete
B. lists representation takes more memory hence memory efficiency is less and go with arrays and arrays have better caching
C. lists have better caching
D. In lists insertion and deletion is difficult
Select an option to see the answer and solution.
AVL trees are more balanced than Red-black trees.
Select an option to see the answer and solution.
Which algorithm is used in the top tree data structure?
A. Divide and Conquer
B. Greedy
C. Backtracking
D. Branch
Select an option to see the answer and solution.
What is the condition for priority of a node in a treap?
A. a node's priority should be greater than its parent
B. a node's priority should be at least as large as its parent
C. the priority is randomly assigned and can have any value
D. a node's priority is always given in decreasing order
Select an option to see the answer and solution.
What is the longest length path for a node x in random binary search tree for the insertion process?
A. log x
B. x2
C. x!
D. 4.311 log x
Select an option to see the answer and solution.
Which of the following options is an application of splay trees?
A. cache Implementation
B. networks
C. send values
D. receive values
Select an option to see the answer and solution.
What is the condition for a tree to be weight balanced. where a is factor and n is a node?
A. weight[n.left] >= a*weight[n] and weight[n.right] >= a*weight[n].
B. weight[n.left] >= a*weight[n.right] and weight[n.right] >= a*weight[n].
C. weight[n.left] >= a*weight[n.left] and weight[n.right] >= a*weight[n].
D. weight[n] is a non zero
Select an option to see the answer and solution.
Given an empty AVL tree, how would you construct AVL tree when a set of numbers are given without performing any rotations?
A. just build the tree with the given input
B. find the median of the set of elements given, make it as root and construct the tree
C. use trial and error
D. use dynamic programming to build the tree
Select an option to see the answer and solution.
A binary tree is a rooted tree but not an ordered tree.
Select an option to see the answer and solution.
Select the code snippet which performs post-order traversal.
Options are not available for this question.
Select an option to see the answer and solution.
How many children does a binary tree have?
A. 2
B. any number of children
C. 0 or 1 or 2
D. 0 or 1
Select an option to see the answer and solution.
Cartesian trees solve range minimum query problem in constant time.
Select an option to see the answer and solution.
What does the following piece of code do?
public void func(Tree root)
{
func(root.left());
func(root.right());
System.out.println(root.data());
}A. Preorder traversal
B. Inorder traversal
C. Postorder traversal
D. Level order traversal
Select an option to see the answer and solution.