A linear data structure has a head and a tail and the elements in between have exactly one predecessor and ond successor. This applies to arrays, right? The quality arrays excel in is that you can access them in a non-linear way even though they are linear data structures.
If you can access the elements in random order, why do you think they have exactly one predecessor and successor? Isn't any element the predecessor and successor of any other element?
We need some inevitable structure in the index to describe what we want. But as I demonstrated under "Definition 2", we are free to choose what that structure is. We've agreed on using integer exactly because it is much more powerful than linear, thus convenient for indexing random access.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A linear data structure has a head and a tail and the elements in between have exactly one predecessor and ond successor. This applies to arrays, right? The quality arrays excel in is that you can access them in a non-linear way even though they are linear data structures.
If you can access the elements in random order, why do you think they have exactly one predecessor and successor? Isn't any element the predecessor and successor of any other element?
..because arrays are indexed data structures and the index says so.
We need some inevitable structure in the index to describe what we want. But as I demonstrated under "Definition 2", we are free to choose what that structure is. We've agreed on using integer exactly because it is much more powerful than linear, thus convenient for indexing random access.