Quantcast

Order of CompositeList

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Order of CompositeList

Fabian Zeindl
Hi,

 is the ordering of lists in a CompositeList guaranteed? When I have a SortedList A1...An and a second SortedList B1...Bn, and I combine those into a CompositeList, the resulting lists order is A1... An-1, An, B1, B2... Bn.

Will this order stay the same if I change the the SortedList A or B?

Regards
Fabian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Order of CompositeList

robeden
Practically it looks like it should right now. However, it's not defined in the API so I wouldn't count on it.

On Thu, Dec 15, 2016 at 3:34 AM Fabian Zeindl <[hidden email]> wrote:
Hi,

 is the ordering of lists in a CompositeList guaranteed? When I have a SortedList A1...An and a second SortedList B1...Bn, and I combine those into a CompositeList, the resulting lists order is A1... An-1, An, B1, B2... Bn.

Will this order stay the same if I change the the SortedList A or B?

Regards
Fabian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Order of CompositeList

Fabian Zeindl
So if I added another SortedList on top to be sure, which runtime penalty will I get for the already sorted list?


> On 15 Dec 2016, at 18:25 , Rob Eden <[hidden email]> wrote:
>
> Practically it looks like it should right now. However, it's not defined in the API so I wouldn't count on it.
>
> On Thu, Dec 15, 2016 at 3:34 AM Fabian Zeindl <[hidden email]> wrote:
> Hi,
>
>  is the ordering of lists in a CompositeList guaranteed? When I have a SortedList A1...An and a second SortedList B1...Bn, and I combine those into a CompositeList, the resulting lists order is A1... An-1, An, B1, B2... Bn.
>
> Will this order stay the same if I change the the SortedList A or B?
>
> Regards
> Fabian

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Order of CompositeList

robeden
Depends on your sort algorithm.

One thing you could do is devise a unit test that would fail if the assumption of CompositeList's behavior. Then you would know if you update in the future and the behavior changes.
On Fri, Dec 16, 2016 at 3:30 AM Fabian Zeindl <[hidden email]> wrote:
So if I added another SortedList on top to be sure, which runtime penalty will I get for the already sorted list?


> On 15 Dec 2016, at 18:25 , Rob Eden <[hidden email]> wrote:
>
> Practically it looks like it should right now. However, it's not defined in the API so I wouldn't count on it.
>
> On Thu, Dec 15, 2016 at 3:34 AM Fabian Zeindl <[hidden email]> wrote:
> Hi,
>
>  is the ordering of lists in a CompositeList guaranteed? When I have a SortedList A1...An and a second SortedList B1...Bn, and I combine those into a CompositeList, the resulting lists order is A1... An-1, An, B1, B2... Bn.
>
> Will this order stay the same if I change the the SortedList A or B?
>
> Regards
> Fabian

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Order of CompositeList

Fabian Zeindl
But that unit-test would depend on the order of ListEvents coming in, wouldn't it?
The list-hierarchy is rather complex, so I'm not sure if I can test this properly.

> On 16 Dec 2016, at 14:24 , Rob Eden <[hidden email]> wrote:
>
> Depends on your sort algorithm.
>
> One thing you could do is devise a unit test that would fail if the assumption of CompositeList's behavior. Then you would know if you update in the future and the behavior changes.
> On Fri, Dec 16, 2016 at 3:30 AM Fabian Zeindl <[hidden email]> wrote:
> So if I added another SortedList on top to be sure, which runtime penalty will I get for the already sorted list?
>
>
> > On 15 Dec 2016, at 18:25 , Rob Eden <[hidden email]> wrote:
> >
> > Practically it looks like it should right now. However, it's not defined in the API so I wouldn't count on it.
> >
> > On Thu, Dec 15, 2016 at 3:34 AM Fabian Zeindl <[hidden email]> wrote:
> > Hi,
> >
> >  is the ordering of lists in a CompositeList guaranteed? When I have a SortedList A1...An and a second SortedList B1...Bn, and I combine those into a CompositeList, the resulting lists order is A1... An-1, An, B1, B2... Bn.
> >
> > Will this order stay the same if I change the the SortedList A or B?
> >
> > Regards
> > Fabian
>

Loading...