间隔,分段,边界树是一样的吗? [英] Are interval, segment, fenwick trees the same?

查看:145
本文介绍了间隔,分段,边界树是一样的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我听了关于fenwick树(二进制索引树)的讲座,老师说这个树是间隔和分段树的泛化,但是我的这三个数据结构的实现是不同的。
这个确定是真的吗?为什么?

Today i listened a lecture about fenwick trees (binary indexed trees) and the teacher says than this tree is a generalization of interval and segment trees, but my implementations of this three data structures are different. Is this afirmation true? and Why?

推荐答案

我从来没有听过二进制索引树称为任何东西的泛化。这绝对不是间隔树段树。我建议你按照这些链接来说服自己。

I have never heard binary indexed trees called a generalization of anything. It's certainly not a generalization of interval trees and segment trees. I suggest you follow the links to convince yourself of this.


比这个树是间隔和段树的一般化

than this tree is a generalization of interval and segment trees

如果通过这棵树,你的老师意思是二进制索引树,那么他是错误的。

If by "this tree" your teacher meant "the binary indexed tree", then he is wrong.


我的这三个数据结构的实现是不同的。

but my implementations of this three data structures are different

当然,他们是不同的,你的老师从来没有说过他们不应该。他只是说一个是另一个的泛化(这不是真的,但仍然)。无论哪种方式,实现都应该是不同的。

Of course they are different, your teacher never said they shouldn't be. He just said one is a generalization of the other (which isn't true, but still). Either way, the implementations are supposed to be different.

相同的实现是二进制索引树和分枝树,因为那些 同样的事情

What would have the same implementation is a binary indexed tree and a fenwick tree, because those are the same thing.

这篇关于间隔,分段,边界树是一样的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆