Aspect | Linear Data Structures | Non Linear Data Structures |
---|
Arrangement of Data | Data items are arranged in sequential order, one after the other | Data items are arranged in non-sequential order (hierarchical manner) |
Layer Presence | All items are present on a single layer | Data items are present at different layers |
Traversability | Can be traversed in a single run. That is, if we start from the first element, we can traverse all elements sequentially in a single pass | Requires 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 Utilization | Is not efficient | Different structures utilize memory in different efficient ways depending on the need |
Time Complexity | Increases with data size | Remains the same |
Examples | Arrays, Stack, Queue | Tree, Graph, Map |