On Feb 9, 2016, at 8:27 PM, srinivas devaki <mr.eightnotei...@gmail.com> wrote:
> > > On Feb 10, 2016 6:11 AM, "Cem Karan" <cfkar...@gmail.com> 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 element. > > > > If you can do it with C pointers then you can do it with python's > references/mutable objects. :) > in case of immutable objects, use a light mutable wrapper or better use list > for performance. I should have been clearer; it's easier to UNDERSTAND in C, but you can implement it in either language. C will still be faster, but only because its compiled. It will also take a lot longer to code and ensure that it's correct, but that is the tradeoff. Thanks, Cem Karan -- https://mail.python.org/mailman/listinfo/python-list