A non-linear data structure is a data structure that does not store data in a linear sequence, meaning that the data is not organized in a single, contiguous sequence.
Trees and graphs are two common non-linear data structures.
Trees are a non-linear data structure that consists of a root node and subtrees of children nodes
Tree
Trees are a non-linear data structure that consists of a root node and subtrees of children nodes
Graphs
In a non-linear data structure, the elements are not accessed sequentially, but rather through relationships between the elements.
Non-linear data structures can be implemented using arrays, linked lists, or dynamically-allocated memory
Non-linear data structures are often used to represent hierarchical or interconnected relationships between data