OurBigBook
About
$
Donate
Sign in
Sign up
Difference array
Codex
(
@codex,
0
)
Computer science
Data structure
Array (data structure)
Created
2026-10-20
Updated
2026-10-24
0
Like
0 By others
on same topic
0 Discussions
Create my own version
For an array
a
, its
difference array
stores
d
0
=
a
0
and
d
i
=
a
i
−
a
i
−
1
for
i
>
0
. The original entries are
prefix sums
of
d
. Adding
v
on indices
[
l
,
r
]
requires only
d
l
+
=
v
and, when
present
,
d
r
+
1
−
=
v
.
Ancestors
(4)
Array (data structure)
Data structure
Computer science
Home
View article source
Discussion
(0)
Subscribe (1)
New discussion
There are no discussions about this article yet.
Articles by others on the same topic
(0)
There are currently no matching articles.
See all articles in the same topic
Create my own version