Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with my homework using Python; please DO NOT use classes in the code just use global or functions to do the task; thanks!

Please help with my homework using Python; please DO NOT use classes in the code just use global or functions to do the task; thanks!

the tree should look like this

image text in transcribed

and here is the input

the list is a 2d array

g=[[1,2,3],

[2,4,5],

[4, 0, 0],

[5,0, 0],

[3,0,6],

[6,0,0]

]

The purpose is to find the height of the tree using recursion; please do not hard code the length of the tree but rather it should check which side is the longest and check the height of that side.

I appreciate your hard work and I promise to upvote it as long as it works and solves the problem.

thanks!

600 The tree should looks like 1 3 N 2 45 3 06 4 6 5 0 0 0 0 0 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

Explain Cybersecurity Breach and its pros and cons?

Answered: 1 week ago