...
/Maintaining a Tree with an Adjacency List
Maintaining a Tree with an Adjacency List
Let's explore the process of maintaining a tree with an Adjacency List.
We'll cover the following...
We'll cover the following...
Many operations can be accomplished using the Adjacency List.
Inserting a new leaf node
Some operations are simple to accomplish with an Adjacency List, such as adding a new leaf node.
Let’s see how we can add a new leaf node:
After inserting the record, let’s retrieve the data in the next playground.
Relocating a single node or a subtree
The process of relocating a single node or a subtree is also easy. Have a look at the next query for more clarification:
We are updating the table by setting 3 as a parent of 6 in the query. Now the parent of node 6 is 3. Let’s ...