in reply to reordering lists
Adding another column to the table to store the sort order may be an idea, but changing the sort order of any one element will entail recalculating the sort order of the all subsequent elements in the table. This is the original "thorny" problem that I am trying to circumvent.
One way I thought up would be to create a sort order that is not sequential but jumps by an increment of, say, 100 or 1000... the way we used to number lines in BASIC... to avoid renumbering lines in case a line has to be moved. So, I would create a column for storing the sort order, but instead of storing 1, 2, 3... I would store 1000, 2000, 3000... Then, if the element 45 with the sort order value 45000 had to be repositioned at slot 3, I would just renumber its sort order value to 2500 (leaving space on both sides, before/downto 2000, and after/upto 3000 without having to recalculate any other element.
Of course, this is inelegant as heck, and is not scalable. But might work.
Any thoughts?
Btw, I am also reading up on linked lists in the hope they may offer some salvation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: reordering lists
by revdiablo (Prior) on Jan 20, 2004 at 21:25 UTC | |
|
Re: Re: reordering lists
by paulbort (Hermit) on Jan 21, 2004 at 23:00 UTC |