Re: Fighting the DList

2020-05-16 Thread Jan Hönig via Digitalmars-d-learn
On Saturday, 16 May 2020 at 08:11:20 UTC, Jan Hönig wrote: I am convinced that this works. I have another implementation, which should work: https://run.dlang.io/is/tfBgD0 It is not pretty. It is probably not fast, if the `ignore` is too large. I guess it is in O(n^2) if not O(mn^2), where m

Fighting the DList

2020-05-16 Thread Jan Hönig via Digitalmars-d-learn
I want a simple algorithm. Given DList (or a Range, Array... I am not constrained by the container type), I want to combine certain elements depending on some condition. In the toy example, the struct and condition are simpler then in my real scenario, but i think it covers my problem: