How many orders of traversal are applicable to a binary tree (In General)?
Select an option to see the answer and solution.
Which of the following properties are obeyed by all three tree - traversals?
A. Left subtrees are visited before right subtrees
B. Right subtrees are visited before left subtrees
C. Root node is visited before left subtree
D. Root node is visited before right subtree
Select an option to see the answer and solution.
Level order traversal of a tree is formed with the help of
A. breadth first search
B. depth first search
C. dijkstra's algorithm
D. prims algorithm
Select an option to see the answer and solution.
Which type of data structure does rope represent?
A. Array
B. Linked List
C. Queue
D. Binary Tree
Select an option to see the answer and solution.
What is inefficient with the below threaded binary tree picture?
A. it has dangling pointers
B. nothing inefficient
C. incorrect threaded tree
D. space is being used more
Select an option to see the answer and solution.
Two balanced binary trees are given with m and n elements respectively. They can be merged into a balanced binary search tree in . . . . . . . . time.
A. O(m+n)
B. O(mn)
C. O(m)
D. O(mlog n)
Select an option to see the answer and solution.
What is missing in this logic of finding a path in the tree for a given sum (i.e checking whether there will be a path from roots to leaf nodes with given sum)?
checkSum(struct bin-treenode *root , int sum) :
if(root==null)
return sum as 0
else :
leftover_sum=sum-root_node-->value
//missingA. code for having recursive calls to either only left tree or right trees or to both subtrees depending on their existence
B. code for having recursive calls to either only left tree or right trees
C. code for having recursive calls to either only left tree
D. code for having recursive calls to either only right trees
Select an option to see the answer and solution.
Which of the below statements are true?
i. Cartesian tree is not a height balanced tree
ii. Cartesian tree of a sequence of unique numbers can be unique generated
A. both statements are true
B. only i. is true
C. only ii. is true
D. both are false
Select an option to see the answer and solution.
Which of the following pair's traversals on a binary tree can build the tree uniquely?
A. post-order and pre-order
B. post-order and in-order
C. post-order and level order
D. level order and preorder
Select an option to see the answer and solution.
What is the time complexity for the update cost on auxiliary trees?
A. O (log (log n))
B. k-1 O (log n)
C. K2 O (log n)
D. k+1 O (log (log n))
Select an option to see the answer and solution.
Which of the following is an advantage of balanced binary search tree, like AVL tree, compared to binary heap?
A. insertion takes less time
B. deletion takes less time
C. searching takes less time
D. construction of the tree takes less time than binary heap
Select an option to see the answer and solution.
What is the prime condition of AA-tree which makes it simpler than a red-black tree?
A. Only right children can be red
B. Only left children can be red
C. Right children should strictly be black
D. There should be no left children
Select an option to see the answer and solution.
How can you save memory when storing color information in Red-Black tree?
A. using least significant bit of one of the pointers in the node for color information
B. using another array with colors of each node
C. storing color information in the node structure
D. using negative and positive numbering
Select an option to see the answer and solution.
Which of the following is incorrect with respect to binary trees?
A. Let T be a binary tree. For every k ≥ 0, there are no more than 2k nodes in level k
B. Let T be a binary tree with λ levels. Then T has no more than 2λ – 1 nodes
C. Let T be a binary tree with N nodes. Then the number of levels is at least ceil(log (N + 1))
D. Let T be a binary tree with N nodes. Then the number of levels is at least floor(log (N + 1))
Select an option to see the answer and solution.
Which node has the lowest priority in a treap?
A. root node
B. leaf node
C. null node
D. centre node
Select an option to see the answer and solution.
What is the time complexity for searching k+1 auxiliary trees?
A. k+2 O (log (log n))
B. k+1 O (log n)
C. K+2 O (log n)
D. k+1 O (log (log n))
Select an option to see the answer and solution.
A treap is a combination of a tree and a heap.
Select an option to see the answer and solution.
An AVL tree is a self - balancing binary search tree, in which the heights of the two child sub trees of any node differ by . . . . . . . .
A. At least one
B. At most one
C. Two
D. At most two
Select an option to see the answer and solution.
Which type of binary tree does rope require to perform basic operations?
A. Unbalanced
B. Balanced
C. Complete
D. Full
Select an option to see the answer and solution.
For the tree below, write the in-order traversal.
A. 6, 2, 5, 7, 11, 2, 5, 9, 4
B. 6, 5, 2, 11, 7, 4, 9, 5, 2
C. 2, 7, 2, 6, 5, 11, 5, 9, 4
D. 2, 7, 6, 5, 11, 2, 9, 5, 4
Select an option to see the answer and solution.