Re: Optimal Structure for Inserting and Deleting
Frans Bouma <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <014101c85de6$13df9460$3b9ebd20$@nl> |
> Frans Bouma wrote:
>
> > As a random bucket of elements always has 'an' order, I pressume
> > it's a forced ordering, i.e. sorted. BUt perhaps I misinterpreted
> > the requirements ;)
>
> I slept my way through school, so I'm uncertain about the terminology, but I
> think things like bags and sets have undefined ordering, whereas structures
> like lists and, like in this case, linked lists, are order-retentive ("have
> 'an' order). Right?
Sometimes people say 'has to keep the order' but that's just the order
the elements come in, not a forced order like sort on field ABC. A list of
elements always has an order, be it undefined or defined. If I have a random
list without a forced ordering and I define operation X which shouldn't change
the ordering, the list should stay in the same order when X is applied, thus
the order the elements are stored in the list.
If _THAT_s meant by Brady, then you have a good point: any linear
structure will do.
If a forced ordering has to be kept, i.e. all rows are sorted on field
ABC and if I insert a new row, it has to be placed at spot A so all rows are
still sorted on ABC after insert, you can't use an array, you need a more
fancier structure, i.e. one which does the sorting for you after insert/add ;)
FB
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com