Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 20581

A tree is a special type of graph which only allows for a hierarchical set of edges similar to a tree . Mathematically it is actually an arborescence. Trees have a root node and children nodes. In formal terms it is described as an acyclic connected graph.

2 votes

O(n)-space, polylog-time subtree sums in incremental forests?

Without loss of generality, assume that $G$ consists of a single tree. First, we reduce the problem to the special case of $G$ being a balanced binary tree. … Insert dummy nodes to turn the tree into a binary tree without increasing the asymptotic height of the tree. …
Mathias Rav's user avatar
9 votes
2 answers
383 views

O(n)-space, polylog-time subtree sums in incremental forests?

Using standard range searching techniques it is possible to obtain $O(n \log n)$ space and polylog query time, or using a kd-tree it is possible to obtain $O(n)$ space and $O(\sqrt n)$ query time. … E.g. the array $A_j$ from the constant-time solution sketched previously can be stored in a balanced search tree (BST) augmented to support subarray sums in $O(\log n)$ time, and $A_{j+1}$ can be built …
Mathias Rav's user avatar