What is the definition for the height of a tree?

前端 未结 7 477
南旧
南旧 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:38

    I think you should take a look at the Dictionary of Algorithms and Data Structures at the NIST website. There definition for height says a single node is height 0.

    The definition of a valid tree does include an empty structure. The site doesn't mention the height of such a tree, but based on the definition of the height, it should also be 0.

提交回复
热议问题