What is the definition for the height of a tree?

前端 未结 7 476
南旧
南旧 2020-12-09 16:43

I can\'t seem to find a definitive answer for this, I\'m trying to do some elementary proofs on heaps but here\'s what\'s throwing me off a little bit:

Is an empt

7条回答
  •  盖世英雄少女心
    2020-12-09 17:33

    According to Wikipedia, the height of a (sub-)tree with one single node is 0. The height of a tree with no nodes would be -1. But I think it's up to you, how you define the height and your proofs should work with either definition.

提交回复
热议问题