473,387 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can somebody give me a python code for this?

Given an array of elements, look at it as a binary tree. Start at the last
interior node, and downheap it. Then downheap the previous interior node,
and continue in this fashion, up to the root.
Feb 7 '07 #1
5 1712
John a écrit :
Given an array of elements, look at it as a binary tree. Start at the last
interior node, and downheap it. Then downheap the previous interior node,
and continue in this fashion, up to the root.

http://www.catb.org/~esr/faqs/smart-....html#homework
Feb 7 '07 #2
hg
John wrote:
Given an array of elements, look at it as a binary tree. Start at the last
interior node, and downheap it. Then downheap the previous interior node,
and continue in this fashion, up to the root.
Your teacher ?

Feb 7 '07 #3
I solved it myself.
Don't bother.

"John" <ru**@jcmills.comwrote in message
news:eq***********@netnews.upenn.edu...
Given an array of elements, look at it as a binary tree. Start at the last
interior node, and downheap it. Then downheap the previous interior node,
and continue in this fashion, up to the root.

Feb 7 '07 #4
On 2007-02-07, John <ru**@jcmills.comwrote:
Given an array of elements, look at it as a binary tree. Start
at the last interior node, and downheap it. Then downheap the
previous interior node, and continue in this fashion, up to
the root.
I'll give you python code for that if you give me your degree
in the remotely possible case where you do graduate...

--
Grant Edwards grante Yow! Is this BOISE??
at
visi.com
Feb 7 '07 #5
John wrote:
I solved it myself.
Don't bother.
Heh heh, I don't think they were going to anyway.
Feb 7 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John Dean | last post by:
Hi I have been reading quite a lot of Python source code recently and I have come across a particular construct which I don't understand. I would be grateful if somebody could explain the reason...
3
by: Patrick | last post by:
Hi, I managed to open a msaccess database with python. import win32com.client.dynamic db1 = win32com.client.dynamic.Dispatch("Access.Application") dbname =...
0
by: John Dean | last post by:
Hi I am in the process of porting Rekall to Mac X OS and I am having trouble finding the Python SDK. I would be grateful if somebody would be kind enough to point me in the right direction ...
3
by: John | last post by:
I am new to c++ programming and i just want to make a program that takes a users name, then converts it to a hex string, then puts it together in a fixed order. An example output would be: ...
2
by: UJ | last post by:
I have a login page that is specified in my web.config in the authentication section. The code is: <authentication mode="Forms"> <forms name="Login" loginUrl="common/Login.aspx"...
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
14
by: cool.vimalsmail | last post by:
i dont know how to convert a txt file into a zip file (i.e.,)i have a file named packages and i want the packages file with a ".gz" extension by implementing a python program
4
by: bustBuddy | last post by:
And it's not me. This is taken verbatim from Mark Lutz's book "Programming Python" you have data.txt: 123 000 999 042 You have adder.py:
6
by: fido19 | last post by:
Once upon a time, there lived a chimpanzee called Luycha Bandor (aka Playboy Chimp). Luycha was unhappily married to Bunty Mona, a short but cute little lady chimp. Luycha was tall and handsome –...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.