Which of the following are true for a complete (full) binary tree?
A. It always has an odd number of vertices.
B. With i internal vertices, it has i + 1 leaves.
C. With l leaves, it has 2l − 1 vertices.
D. With 2n − 1 vertices, it has n leaves.
Choose the correct answer from the options given below:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. A, B, C, D
Explanation
In a full binary tree (every internal node has 2 children), l = i + 1 and n = 2i + 1 = 2l − 1, which is always odd. All four statements follow.More Data Structures and Algorithms questions
- In a ______ the left and right subtrees of some node differ in height by more than one.
- FFTs are ______ techniques used to encode digital video and audio information and help analyse the signal in the ____ domain.
- Given six weights 4, 15, 25, 5, 8, 16, construct a 2-tree (extended binary tree) with minimum weighted path length. What is the minimum wei…
- Suppose we store n keys in a hash table of size m = n² using a hash function h chosen randomly from a universal class of hash functions. Th…
- Which of the following rotations are correctly explained in the context of an AVL tree? A. LL rotation: the new node is inserted in the lef…
- In the context of Hamiltonian problems, which of the following are correct? A. The Hamiltonian cycle problem is NP-complete. B. If G is an…