Programming Concepts — Tree
A tree is a hierarchical data structure consisting of nodes connected by edges, with one root node at the top. Trees are used in databases, file systems, and more.
const tree = {
value: 'Root',
children: [
{ value: 'Child 1', children: [] },
{ value: 'Child 2', children: [] }
]
};
console.log(tree.children[0].value); // Output: Child 1