Why list<T> rather than Chain<T>
A Chain actually has "links", and it makes more sense. You can show graphically how to insert a link into a chain and it makes sense. A list has nothing to do with the data structure it represents. So why not use a Chain instead of a list?
farmersckn
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
December 18, 2000 04:08 PM
Backwords compatibility. It''s been called a list since the beginning of programming, it''s to late to change now.
Besides, what you''re thinking of is just one specific way to implement a list. A list is a generic object. C programmers are trained to think that "list" means "a bunch of memory blocks with pointers between them" just like they''re trained to think that "string" means a char * to a buffer with a 0 at the end. But that''s not the only way to get things done.
-Mike
Besides, what you''re thinking of is just one specific way to implement a list. A list is a generic object. C programmers are trained to think that "list" means "a bunch of memory blocks with pointers between them" just like they''re trained to think that "string" means a char * to a buffer with a 0 at the end. But that''s not the only way to get things done.
-Mike
All the same, but who''s the d.a. who thought up linked list? I thought objects were supposed to model their real-world counterpart...
farmersckn
farmersckn
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
Linked lists have been around since LONG before C++ and objects. So the whole OO idea of naming things after their real world counterpart wasn''t around.
Also, if say they were just called "lists" it wouldn''t make much sense. However, they called them "linked-lists" suggesting that the items in the list were linked in some way. Chain would be a more interesting term, but actually in a way linked-list is better because it suggests that there is actual data (items in a list) being stored. While a chain just suggests something that is linked together, and a list is just a list that can be stored in any way.
-Omalacon
Also, if say they were just called "lists" it wouldn''t make much sense. However, they called them "linked-lists" suggesting that the items in the list were linked in some way. Chain would be a more interesting term, but actually in a way linked-list is better because it suggests that there is actual data (items in a list) being stored. While a chain just suggests something that is linked together, and a list is just a list that can be stored in any way.
-Omalacon
Linked list were created long before objects were.
There''s two ideas, the logical containers (Bags) and thier implementations, often they have equivacated names.
And a list may or may not be implemented with a linked list.
A Stack could use a linked list or an array...
There''s two ideas, the logical containers (Bags) and thier implementations, often they have equivacated names.
And a list may or may not be implemented with a linked list.
A Stack could use a linked list or an array...
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement