πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!


    Question

    A complete binary tree has 127 nodes. What is its height

    (assuming the root is at level 0)?
    A 5 Correct Answer Incorrect Answer
    B 6 Correct Answer Incorrect Answer
    C 7 Correct Answer Incorrect Answer
    D 8 Correct Answer Incorrect Answer
    E 9 Correct Answer Incorrect Answer

    Solution

    For a complete binary tree, the number of nodes N = 2^(h+1) - 1, where h is the height. 127 = 2^(h+1) - 1 128 = 2^(h+1) 2^7 = 2^(h+1) 7 = h+1 h = 6

    Practice Next
    ask-question
    9