[Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8800 >
Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8800 >
>
> Raimar Falke wrote:
>
>
>>I think this is a bit bold to say. If you for example change the size
>>a lot the list has less overhead (malloc + copy).
>
> I doubt that very much. Can you show numbers?
Well, nevermind - that would be a waste of time.
Both speclist and specvec are O(1) on insert and most other operations.
Specvec is O(1) on indexed lookups, whereas speclist is O(n).
Speclist can only handle pointers, specvec can handle any data type.
Speclist's interface is a little easier for unordered lists.
With specvec it is impossible to delete elements from the middle. Or at
best it's O(n) if you do it manually (compared to O(1) for speclist).
jason
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Jason Short, 2004/05/21
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Raimar Falke, 2004/05/22
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Jason Short, 2004/05/22
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec,
Jason Short <=
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Raimar Falke, 2004/05/22
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Vasco Alexandre da Silva Costa, 2004/05/22
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Per Inge Mathisen, 2004/05/22
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Raimar Falke, 2004/05/22
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Raimar Falke, 2004/05/22
- [Freeciv-Dev] Re: (PR#8800) [RFC] Usage of speclist vs specvec, Per Inge Mathisen, 2004/05/22
|
|