GATE 2004 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2004

199 questions

MCQ 1991-mark 199

Questions 106–110 of 199

Q106Binary Tree1 markMCQ−0.33 if wrong
Consider the label sequences obtained by the following pairs of traversals on a labeled binary tree. Which of these pairs identify a tree uniquely?

(i) preorder and postorder
(ii) inorder and postorder
(iii) preorder and inorder
(iv) level order and postorder

Q107Binary Tree1 markMCQ−0.33 if wrong
Level order traversal of a rooted tree can be done by starting from the root and performing

Q108Binary Search Tree1 markMCQ−0.33 if wrong
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)?

Q109AVL Tree1 markMCQ−0.33 if wrong
A program takes as input a balanced binary search tree with n leaf nodes and computes the value of a function g(x) for each node x. If the cost of computing g(x) is min{no. of leaf-nodes in left-subtree of x, no. of leaf-nodes in right-subtree of x} then the worst-case time complexity of the program is

Q110Heap Tree1 markMCQ−0.33 if wrong
An array of integers of size n can be converted into a heap by adjusting the heaps rooted at each internal node of the complete binary tree starting at the node ⌊(n−1)/2⌋\left \lfloor (n - 1) /2 \right \rfloor, and doing this adjustment up to the root node (root node is at index 0) in the order ⌊(n−1)/2⌋\left \lfloor (n - 1) /2 \right \rfloor,⌊(n−3)/2⌋\left \lfloor (n - 3) /2 \right \rfloor, ....., 0. The time required to construct a heap in this manner is