Re: Heap Implementation

2016-02-11 Thread Cem Karan
On Feb 10, 2016, at 1:23 PM, "Sven R. Kunze" wrote: > Hi Cem, > > On 08.02.2016 02:37, Cem Karan wrote: >> My apologies for not writing sooner, but work has been quite busy lately >> (and likely will be for some time to come). > > no problem here. :) > >> I read your approach, and it looks p

Re: Heap Implementation

2016-02-10 Thread Sven R. Kunze
Hi Cem, On 08.02.2016 02:37, Cem Karan wrote: My apologies for not writing sooner, but work has been quite busy lately (and likely will be for some time to come). no problem here. :) I read your approach, and it looks pretty good, but there may be one issue with it; how do you handle the s

Re: Heap Implementation

2016-02-09 Thread Cem Karan
On Feb 9, 2016, at 8:27 PM, srinivas devaki wrote: > > > On Feb 10, 2016 6:11 AM, "Cem Karan" wrote: > > > > Eh, its not too bad once you figure out how to do it. It's easier in C > > though; you can use pointer tricks that let you find the element in > > constant time, and then removal wi

Re: Heap Implementation

2016-02-09 Thread srinivas devaki
On Feb 10, 2016 6:11 AM, "Cem Karan" wrote: > > Eh, its not too bad once you figure out how to do it. It's easier in C though; you can use pointer tricks that let you find the element in constant time, and then removal will involve figuring out how to fix up your heap after you've removed the ele

Re: Heap Implementation

2016-02-09 Thread Cem Karan
On Feb 9, 2016, at 9:27 AM, Mark Lawrence wrote: > On 09/02/2016 11:44, Cem Karan wrote: >> >> On Feb 9, 2016, at 4:40 AM, Mark Lawrence wrote: >> >>> On 09/02/2016 04:25, Cem Karan wrote: No problem, that's what I thought happened. And you're right, I'm looking for a priori

Re: Heap Implementation

2016-02-09 Thread Mark Lawrence
On 09/02/2016 11:44, Cem Karan wrote: On Feb 9, 2016, at 4:40 AM, Mark Lawrence wrote: On 09/02/2016 04:25, Cem Karan wrote: No problem, that's what I thought happened. And you're right, I'm looking for a priority queue (not the only reason to use a heap, but a pretty important reason!)

Re: Heap Implementation

2016-02-09 Thread Cem Karan
On Feb 9, 2016, at 4:40 AM, Mark Lawrence wrote: > On 09/02/2016 04:25, Cem Karan wrote: >> >> No problem, that's what I thought happened. And you're right, I'm looking >> for a priority queue (not the only reason to use a heap, but a pretty >> important reason!) >> > > I'm assuming I've m

Re: Heap Implementation

2016-02-09 Thread Mark Lawrence
On 09/02/2016 04:25, Cem Karan wrote: No problem, that's what I thought happened. And you're right, I'm looking for a priority queue (not the only reason to use a heap, but a pretty important reason!) I'm assuming I've missed the explanation, so what is the problem again with https://docs

Re: Heap Implementation

2016-02-08 Thread Cem Karan
On Feb 8, 2016, at 10:12 PM, srinivas devaki wrote: > > On Feb 8, 2016 5:17 PM, "Cem Karan" wrote: > > > > On Feb 7, 2016, at 10:15 PM, srinivas devaki > > wrote: > > > On Feb 8, 2016 7:07 AM, "Cem Karan" wrote: > > > > I know that there are methods of handling this from the client-side >

Re: Heap Implementation

2016-02-08 Thread srinivas devaki
On Feb 8, 2016 5:17 PM, "Cem Karan" wrote: > > On Feb 7, 2016, at 10:15 PM, srinivas devaki wrote: > > On Feb 8, 2016 7:07 AM, "Cem Karan" wrote: > > > I know that there are methods of handling this from the client-side (tuples with unique counters come to mind), but if your library can handle i

Re: Heap Implementation

2016-02-08 Thread Cem Karan
On Feb 7, 2016, at 10:15 PM, srinivas devaki wrote: > On Feb 8, 2016 7:07 AM, "Cem Karan" wrote: > > I know that there are methods of handling this from the client-side (tuples > > with unique counters come to mind), but if your library can handle it > > directly, then that could be useful to o

Re: Heap Implementation

2016-02-07 Thread srinivas devaki
On Feb 8, 2016 7:07 AM, "Cem Karan" wrote: > > > > I know that there are methods of handling this from the client-side (tuples with unique counters come to mind), but if your library can handle it directly, then that could be useful to others as well. yeah it is a good idea to do at client side.

Re: Heap Implementation

2016-02-07 Thread Cem Karan
On Jan 30, 2016, at 5:47 PM, Sven R. Kunze wrote: > Hi again, > > as the topic of the old thread actually was fully discussed, I dare to open a > new one. > > I finally managed to finish my heap implementation. You can find it at > https://pypi.python.org/pypi/xheap

Re: Heap Implementation

2016-02-02 Thread Sven R. Kunze
On 02.02.2016 01:48, srinivas devaki wrote: On Feb 1, 2016 10:54 PM, "Sven R. Kunze" > wrote: > > Maybe I didn't express myself well. Would you prefer the sweeping approach in terms of efficiency over how I implemented xheap currently? > complexity wise your approach

Re: Heap Implementation

2016-02-02 Thread Oscar Benjamin
On 2 February 2016 at 05:38, Steven D'Aprano wrote: > > In effect, each measurement you take is made up of two components: > > * the actual time that the code would take if it had exclusive > access to the machine with no other programs running, call it t; > > * and the noise added by the system

Re: Heap Implementation

2016-02-01 Thread Steven D'Aprano
On Tuesday 02 February 2016 06:32, Sven R. Kunze wrote: > On 31.01.2016 02:48, Steven D'Aprano wrote: >> On Sunday 31 January 2016 09:47, Sven R. Kunze wrote: >> >>> @all >>> What's the best/standardized tool in Python to perform benchmarking? >> timeit > Thanks, Steven. > > Maybe, I am doing it

Re: Heap Implementation

2016-02-01 Thread srinivas devaki
On Feb 1, 2016 10:54 PM, "Sven R. Kunze" wrote: > > Maybe I didn't express myself well. Would you prefer the sweeping approach in terms of efficiency over how I implemented xheap currently? > complexity wise your approach is the best one of all that I have seen till now > Without running some be

Re: Heap Implementation

2016-02-01 Thread Sven R. Kunze
On 31.01.2016 02:48, Steven D'Aprano wrote: On Sunday 31 January 2016 09:47, Sven R. Kunze wrote: @all What's the best/standardized tool in Python to perform benchmarking? timeit Thanks, Steven. Maybe, I am doing it wrong but I get some weird results: >>> min(timeit.Timer('for _ in range(10

Re: Heap Implementation

2016-02-01 Thread Sven R. Kunze
it is brilliant of you to simply use __setitem__ Thanks. :) On Sun, Jan 31, 2016 at 4:17 AM, Sven R. Kunze wrote: Hi again, as the topic of the old thread actually was fully discussed, I dare to open a new one. I finally managed to finish my heap implementation. You can find it at

Re: Heap Implementation

2016-01-30 Thread srinivas devaki
simply use __setitem__ On Sun, Jan 31, 2016 at 4:17 AM, Sven R. Kunze wrote: > Hi again, > > as the topic of the old thread actually was fully discussed, I dare to open > a new one. > > I finally managed to finish my heap implementation. You can find it at > https://pypi.

Re: Heap Implementation

2016-01-30 Thread Steven D'Aprano
On Sunday 31 January 2016 09:47, Sven R. Kunze wrote: > @all > What's the best/standardized tool in Python to perform benchmarking? timeit -- Steve -- https://mail.python.org/mailman/listinfo/python-list

Heap Implementation

2016-01-30 Thread Sven R. Kunze
Hi again, as the topic of the old thread actually was fully discussed, I dare to open a new one. I finally managed to finish my heap implementation. You can find it at https://pypi.python.org/pypi/xheap + https://github.com/srkunze/xheap. I described my motivations and design decisions at