We have a root node (only one) and several children nodes,each one with its own children as well. It's a tree-based structure.
Something like:
root
/
a b
|
c
We need two HTTP APIs that will serve the two basic operations:
- Get all descendant nodes of a given node (the given node can be anyone in the tree structure).
- Change the parent node of a given node (the given node can be anyone in the tree structure). They need to answer quickly, even with tons of nodes. Also,we can't afford to lose this information, so some sort of persistence is required. Each node should have the following info:
- node identification
- who is the parent node
- who is the root node
- the height of the node. In the above example,height(root) = 0 and height(a) == 1.