为什么绳索仅在叶子处存储数据?

时间:2019-05-25 08:39:38

标签: data-structures

如果您查看维基百科上绳索的定义:

A rope is a binary tree where each leaf (end node) holds a string and a length (also known as a "weight"), and each node further up the tree holds the sum of the lengths of all the leaves in its left subtree

为什么用于字符串的绳索最终只能在叶节点处获得数据? 例如,您是否有理由不使用avl并在树中的每个节点上存储字符串?

0 个答案:

没有答案