OrderedSet?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OrderedSet?

Peter Uhnak
Hi,

what would be the equivalent of an OrderedSet?

1. all elements are unique

2. they are ordered

3. adding an existing element moves it
so
myOrderedSet addLast: x. "<- x is added as last"
myOrderedSet addFirst: x. "<- x is moved from last to first"

Thanks,

--
Peter

Reply | Threaded
Open this post in threaded view
|

Re: OrderedSet?

hernanmd

2015-12-05 23:21 GMT-03:00 Peter Uhnak <[hidden email]>:
Hi,

what would be the equivalent of an OrderedSet?

1. all elements are unique

2. they are ordered

3. adding an existing element moves it
so
myOrderedSet addLast: x. "<- x is added as last"
myOrderedSet addFirst: x. "<- x is moved from last to first"

Thanks,

--
Peter