Python Forum
Implementing a recursive algorithm for tree.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Implementing a recursive algorithm for tree.
#3
Hi Thanks for replying,
I'm learning how to use BBcode
I can't make the max_profit function to work,
The map is giving problem, It was supposed to take a function as a first argument and iterable as another,
but Its giving a error as:
Error:
Traceback (most recent call last): File "f:\coding n stuffs\asdfasda.py", line 97, in <module> y = tree.max_profit(1) File "f:\coding n stuffs\asdfasda.py", line 65, in max_profit return max(-x,self[identifier] + sum(map(max_profit, self[identifier].children))) NameError: name 'max_profit' is not defined
PS F:\coding n stuffs>

sorry for not formatting I'm going through the help page to learn bbcode.
Reply


Messages In This Thread
RE: Implementing a recursive algorithm for tree. - by Negativ3 - Apr-10-2019, 10:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Combine Two Recursive Functions To Create One Recursive Selection Sort Function Jeremy7 12 7,554 Jan-17-2021, 03:02 AM
Last Post: Jeremy7
  Problem by implementing IDF moat335 0 1,541 Apr-30-2020, 11:33 AM
Last Post: moat335
  Implementing OAuth 2 ( 2-legged) krishnanunnik 2 2,192 Sep-16-2019, 11:13 AM
Last Post: krishnanunnik
  Error in implementing multithreading in a class srm 2 2,184 May-16-2019, 03:54 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020