Let π be an odd number greater than 100. Consider a binary minheap with
π elements stored in an array π whose index starts from 1.
Which of the following indices of π do/does NOT correspond to any leaf node of
the minheap?
We have a binary min-heap with n elements (n odd, n > 100) stored in array P with 1-based indexing. We need to identify which given index does NOT correspond to a leaf node.
Step 1: Recall the leaf-node rule for a 1-indexed binary heap.
In a binary heap stored in an array with indices starting at 1, the parent of the node at index i is at \(\lfloor i/2 \rfloor\), so a node at index i is an internal node (has at least one child) if and only if \(2i \le n\), i.e., \(i \le \lfloor n/2 \rfloor\). Consequently, a node is a leaf if and only if \(i \gt \lfloor n/2 \rfloor\).
Step 2: Simplify \(\lfloor n/2 \rfloor\) for odd n.
Since n is odd, \(n = 2k+1\) for some integer k, so \(\lfloor n/2 \rfloor = k = \dfrac{n-1}{2}\). So leaf indices are exactly those with \(i \gt \dfrac{n-1}{2}\), and internal-node indices satisfy \(i \le \dfrac{n-1}{2}\).
Step 3: Test each option against this boundary.
Option (A): \(i = \dfrac{n+1}{2} = \dfrac{n-1}{2} + 1\). This is strictly greater than \(\dfrac{n-1}{2}\), so it IS a leaf.
Option (B): \(i = \dfrac{n-1}{2}\). This exactly equals the internal-node boundary \(\dfrac{n-1}{2}\), so it is an internal node, NOT a leaf.
Option (C): \(i = \dfrac{n-3}{2} = \dfrac{n-1}{2} - 1\). This is strictly less than \(\dfrac{n-1}{2}\), so it is also an internal node, NOT a leaf.
Option (D): \(i = n\), the very last index, which always satisfies \(n \gt \dfrac{n-1}{2}\) for n > 1, so it IS a leaf.
Step 4: Conclude.
The indices that do NOT correspond to a leaf node are \(\dfrac{n-1}{2}\) (option B) and \(\dfrac{n-3}{2}\) (option C).
\[ \boxed{\text{Options B and C}} \]A schedule of three database transactions \(T_1\), \(T_2\), and \(T_3\) is shown. \(R_i(A)\) and \(W_i(A)\) denote read and write of data item A by transaction \(T_i\), \(i = 1, 2, 3\). The transaction \(T_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?

The height of a binary tree is the number of edges in the longest path from the root
to a leaf in the tree. The maximum possible height of a full binary tree with
23 nodes is _________. (answer in integer)

Let π be the set of all integers from 1 to 15. Consider any order of insertion of the
elements of π into a binary search tree that creates a complete binary tree.
Which one of the following elements can NEVER be the third element that is
inserted?

The set T represents various traversals over binary tree. The set S represents the
order of visiting nodes during a traversal.
T
S
I: Inorder
L: left subtree, node, right subtree
II: Preorder
M: node, left subtree, right subtree
III: Postorder N: left subtree, right subtree, node
Which one of the following is the correct match from T to S ?

Consider a binary search tree (BST) with π leaf nodes (π> 0). Given any node π,
the key present in the node is denoted as πππ(π). All the keys present in the given
BST are distinct. The keys belong to the set of real numbers.
For a node π, let ππ’π(π) denote the node that is its inorder successor. If a node π
does not have an inorder successor, then ππ’π(π) is πππΏπΏ. As there are no
duplicates, if ππ’π(π) is not πππΏπΏ, then πππ(π) < πππ(ππ’π(π)).
Corresponding to every leaf node πΏπ that has a non-NULL ππ’π(πΏπ), a new key ππ
with the following property is to be inserted into the BST.
πππ(πΏπ) < ππ< πππ(ππ’π(πΏπ))
Let πΎ represent the list of all such new keys to be inserted into the BST.
Which of the following statements is/are true?

The following sequence corresponds to the preorder traversal of a binary search
tree π:
50, 25, 13, 40, 30, 47, 75, 60, 70, 80, 77
The position of the element 60 in the postorder traversal of π is ______. (answer in
integer)
Note: The position begins with 1.
