Posts

Non-linear dynamic structures

Image
So far, all we’ve seen have been linear data structures, but sometimes other types of hierarchical data structures like trees or graphs are needed. The aim of this section is to introduce you to these structures in order to know them superficially, require experience and some extra knowledge that prevents deepening in their study. Trees As mentioned, a tree is a hierarchical and nonlinear data structure constituted by a set of homogeneous elements, that is to say of the same type, which are characterized because they establish a hierarchy between the elements that form it. This hierarchical relationship between its nodes is established so that all nodes that make up the tree have a single parent node, which is the node that precedes it in the hierarchy. The only exception is the root node, which can be defined as that node that has no parent. All trees have only one root. Each node can have 0, 1 or more of a child node. A child node is one that happens to it in the hierarchy. If a node...