Re: Efficient Data Structures




Rick Lones wrote:
> You won't *necessarily* get great efficiency on both insertion and removal. But
> given your description so far it sounds as if you can - I would try a
> SortedList. The insertion uses .Add(object key, object value) - which *should*
> be efficient, at least if the key elements arrive in anything like random order.
> (Test it!) You can remove elements either with .Remove(object key) or
> .RemoveAt(int index) - index being 0 in your case of removing the element with
> least key. Either of these *should* be quite efficient (O(log n) at worst) *if*
> the list is internally maintained sorted as per the documentation. (Again, test
> it!)
>
> HTH,
> -rick-

Actually, Add and Remove on the SortedList are O(n log n)
implementations.

.



Relevant Pages

  • Re: SortedList vs Own sorted array
    ... As far as gaining a speed improvement, insertion will certainly be ... Most programmers I've known that got bent out of shape over ... My advice: never "code for efficiency." ... use patently stupid data structures and strategies in your design), ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Relational model versus object model
    ... >> implementations of the relational model vs. present implementations in ... The logical physical confusion strikes again. ... but it allows better efficiency thanks to the ... than OOA/D applied to data management. ...
    (comp.object)
  • Re: Mystery: static variables & performance
    ... not about implementations of it. ... your presumption of clean separability between language definition ... and efficiency is naive at best, ...
    (comp.lang.c)
  • Re: How to concatenate lines continued with ?
    ... note that efficiency and portability are two particularly ... compare the runtimes of "awk" when awk might be any of a number of ... different implementations ("classic" oawk, nawk, xpg4/bin/awk, mawk, gawk, ... Having said that, I think you will find that of the AWK solutions, mawk ...
    (comp.unix.shell)
  • Re: Mystery: static variables & performance
    ... >> C language, not about implementations of it. ... >and efficiency is naive at best, ... CLC FAQ ...
    (comp.lang.c)

Loading