Binary Index Tree (BIT)
摘要:
Binary Index Tree (BIT)是种数据结构,支持两种操作:1. update(index,value): A[index]+=value.2. sum(index): return A[1]+...+A[index]. (从A[1]开始,不是A[0])我们发现update的复杂度是O(1),而sum的复杂度为O(n)。然而,当我们需要频繁调用sum时,O(n)的复杂度就不那么满意了。BIT这种数据结构,对于update和sum的复杂度都为O(log n)。这是使用BIT的原因。BIT的介绍在下面:http://community.topcoder.com/tc?module=S 阅读全文
posted @ 2013-04-07 19:36
wujie27
阅读(229)
评论(0)
推荐(0)
浙公网安备 33010602011771号