|
|
On 06/12/2012 07:54 AM, Warp wrote:
> Orchid Win7 v1<voi### [at] devnull> wrote:
>> The C# "List" class actually represents a growable array. So it has O(1)
>> index and O(1) append until the underlying array needs to be enlarged
>> (which is obviously O(n) time).
>
> Why is C# using the wrong terminology? (Or at the very least, really
> misleading?)
>
> What that sounds more like is a dynamic array, not a list.
Yeah, I don't really know.
Java has a /interface/ called "list", which represents "a list of
things". It then provides several different implementations of this
interface, including "LinkedList" and "ArrayList".
C# seems to have copied this terminology, having an IList interface and
a List class which implements it. But it's certainly nothing to do with
linked lists (which don't implement IList at all, and hence don't even
*offer* element indexing as a build-in method).
Go sue the designers. :-P
Post a reply to this message
|
|