Reputation: 0 Apprentice
- Active Posts:
- 17 (0.02 per day)
- 27-October 11
- Profile Views:
- Last Active:
- Oct 05 2012 12:26 AM
- Dream Kudos:
Posts I've Made
Posted 5 Oct 2012figured it out, lock pl0x
Posted 4 Oct 2012maybe someone would be kind enough to provide an algorithm/pseudocode on the correct way of turning an unsorted array into a heap? please? i don't understand where i have gone wrong...
Posted 4 Oct 2012
QuoteNope! That's probably not going to happen.anyone care to provide a working implementation so i can see which assumption used in my approach is wrong?
Let's instead try to fix your code. What is the output you're getting, what is the output you should be getting?
Nothing is changed for an array with an odd number of items for example . I should be getting a heap where the first item is smaller than the next two items, etc.
Posted 16 Jul 2012First of all, thanks for your reply. Ok, so I tried your solution. I have renamed the modules to correct names. Now, inside script.py I am trying to run a couple of functions inside one.py and two.py as:
import folder1.one import folder2.two a = func1('someparam') #func1 is a function inside one.py b = func2('someotherparam') #func2 is a function inside two.py
the ff error appears (it stops at line 4 in the code above)
NameError: name 'func1' is not defined
The same error appears even if I try:
import folder1.one import folder2.two a = one.func1('someparam') #func1 is a function inside one.py b = two.func2('someotherparam') #func2 is a function inside two.py
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
neojiphre hasn't added any friends yet.