Search code examples
algorithmcircular-list

Is "Circular" list a kind of "linear list"?


I'm not sure what kind of "list", could be considered as "linear list".

For example, if the concept "linear" means we have one and only one rule to say what is the "next" element: then "Circular list", should also be "linear list"?

If yes, then "general lists", although they could have high dimensional structure, but as long as we give the rule of how to find "next" element, could it be considered as "linear list"?


Solution

  • Circular lists are linear data structures. However, it is not sufficient to give a rule for finding next element: in order for the structure to be linear, a single element must not be the next element to more than one element.

    For example, the structure below is not linear:

    Non-linear list

    Although each node has at most one successor, node "C" is a successor to two other nodes - "B" and "F". The structure is, therefore, cannot be considered linear.

    A list of linear data structures can be found here.