Skip to main content

Definition

Linear vs Non-Linear Data Structures​

AspectLinear Data StructuresNon Linear Data Structures
Arrangement of DataData items are arranged in sequential order, one after the otherData items are arranged in non-sequential order (hierarchical manner)
Layer PresenceAll items are present on a single layerData items are present at different layers
TraversabilityCan be traversed in a single run. That is, if we start from the first element, we can traverse all elements sequentially in a single passRequires multiple runs. That is, if we start from the first element, it might not be possible to traverse all elements in a single pass
Memory UtilizationIs not efficientDifferent structures utilize memory in different efficient ways depending on the need
Time ComplexityIncreases with data sizeRemains the same
ExamplesArrays, Stack, QueueTree, Graph, Map