How to distinguish linear structure from nonlinear structure in C language?

A linear structure is an ordered set of data elements. Among them, the relationship between data elements is one-to-one, that is, all data elements are connected end to end except the first and last data elements. Commonly used linear structures are: linear table, stack, queue, double queue, array and string.

Second, each data element in the nonlinear structure no longer maintains a linear sequence, and each data element can be associated with zero or more other data elements. According to different relationships, it can be divided into hierarchical structure and group structure.

1. Hierarchy is a collection of data elements divided by hierarchy, and the elements on the specified hierarchy can be zero, or they can be more direct subordinate elements at the next level. The most typical hierarchical structure is a tree structure, such as Linux file system.

2. There is no order relationship among all elements in the group structure, and the most typical group structure is set and graph.