Re: Opportunistic worst-case complexity upgrade? aka binary search with `find`

2014-07-27 Thread Xinok via Digitalmars-d
On Thursday, 24 July 2014 at 01:26:48 UTC, Jakob Ovrum wrote: On Thursday, 24 July 2014 at 01:21:44 UTC, Jakob Ovrum wrote: -snip- Another point is that the range types of the two currently available sorted containers - RedBlackTree and BinaryHeap - are *not* instances of SortedRange. If

Re: Opportunistic worst-case complexity upgrade? aka binary search with `find`

2014-07-26 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 24 July 2014 at 21:08:58 UTC, Jonathan M Davis wrote: On Thursday, 24 July 2014 at 01:26:48 UTC, Jakob Ovrum wrote: On Thursday, 24 July 2014 at 01:21:44 UTC, Jakob Ovrum wrote: -snip- Another point is that the range types of the two currently available sorted containers -

Re: Opportunistic worst-case complexity upgrade? aka binary search with `find`

2014-07-24 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 24 July 2014 at 01:26:48 UTC, Jakob Ovrum wrote: On Thursday, 24 July 2014 at 01:21:44 UTC, Jakob Ovrum wrote: -snip- Another point is that the range types of the two currently available sorted containers - RedBlackTree and BinaryHeap - are *not* instances of SortedRange. If

Opportunistic worst-case complexity upgrade? aka binary search with `find`

2014-07-23 Thread Jakob Ovrum via Digitalmars-d
We should talk about a design question surrounding binary search with `canFind`/`find` and possibly other linear-search functions. Currently we have binary search in Phobos as part of std.range.SortedRange. Its interface is not compatible with `canFind` or `find` - you can't simply wrap the

Re: Opportunistic worst-case complexity upgrade? aka binary search with `find`

2014-07-23 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 24 July 2014 at 01:21:44 UTC, Jakob Ovrum wrote: -snip- Another point is that the range types of the two currently available sorted containers - RedBlackTree and BinaryHeap - are *not* instances of SortedRange. If algorithms working on sorted ranges become a thing, it seems