Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #102743 > unrolled thread

Re: Heap Implementation

Started bysrinivas devaki <mr.eightnoteight@gmail.com>
First post2016-02-10 06:57 +0530
Last post2016-02-10 06:57 +0530
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Heap Implementation srinivas devaki <mr.eightnoteight@gmail.com> - 2016-02-10 06:57 +0530

#102743 — Re: Heap Implementation

Fromsrinivas devaki <mr.eightnoteight@gmail.com>
Date2016-02-10 06:57 +0530
SubjectRe: Heap Implementation
Message-ID<mailman.7.1455067638.7749.python-list@python.org>
On Feb 10, 2016 6:11 AM, "Cem Karan" <cfkaran2@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.

Regards
Srinivas Devaki
Junior (3rd yr) student at Indian School of Mines,(IIT Dhanbad)
Computer Science and Engineering Department
ph: +91 9491 383 249
telegram_id: @eightnoteight

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web