in reply to Re: Sort mechanics problems ...
in thread Sort mechanics problems with objects and potentially contradicting comparisons (would cause infinite loop)
The problem with sample code that is already wrong is that it night have a different problem from the same theoretical weakness. So the issue of circular dependencies should be resolved in theory before writing any more code.
The optimisation part is best done using an orcish manoeuvre than a schwartzian transform because it is a question of not doing the same processing twice although the sort algorithm will call the function many times with the same table appearing in $a or $b for successive iterations. Except that this time, apart from storing past processing results of individual elements to prevent reiterating them I need also to store past comparisons to check for circular dependencies.
One world, one people
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sort mechanics problems ...
by haukex (Archbishop) on Jun 01, 2016 at 18:29 UTC | |
by anonymized user 468275 (Curate) on Jun 02, 2016 at 06:41 UTC | |
by tye (Sage) on Jun 02, 2016 at 07:32 UTC | |
by haukex (Archbishop) on Jun 02, 2016 at 08:29 UTC | |
by anonymized user 468275 (Curate) on Jun 02, 2016 at 10:51 UTC |