Reputation: 168
I was explaining basic data structure to a non-programmer. And I explained that an array or list is a collection. For example, an array is a collection of numbers, names or things: a pencil box where there are many pencils.
After explaining lists, I tried to explain linked lists, describing them as something where lists are connected (linked). However in most of the examples for linked lists, I don’t see lists getting connected. rather objects or nodes get linked.
My question is: why it is called “linked list”? Why not “linked nodes” or “linked object”?
Upvotes: 0
Views: 84
Reputation: 3826
It is a shorthand for a list made up of linked items. A linked braking system is created from linking front and rear brakes, which makes the system. Here linking the items makes the list.
Upvotes: 2
Reputation: 8513
Typically a list is a collection type that allows you to get elements by a position or insert elements into specific positions.
A list can be implemented using an array internally and is typically called "array list". It can also be implemented as a sequence of linked (or most likely doubly linked) elements, and would be called "linked list".
Another example would be a set; it could be a hashed set of elements when the order does not matter or a tree set that keeps element in a sorted order.
Upvotes: 4