Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise (20 points) Let R be a binary tree of integers without repetition, (each node contains a value whole), it is assumed that the tree

Exercise (20 points)
Let R be a binary tree of integers without repetition, (each node contains a value
whole), it is assumed that the tree is already created.
Write an algorithm that allows to:
1) Calculate and display the product of the values stored in the nodes of the tree R, (if the tree is empty the algorithm must display the zero). (7 dots)
2) Calculate and display the depth of the node which contains a given value (V), (if the tree is empty, or (V) does not exist, the algorithm must display (-1)). (6.5 marks)
3) Create and display a linked linear list (L) containing a path connecting the node
of the root with the one that contains the value (V). (6.5 marks)

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_2

Step: 3

blur-text-image_3

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

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

What media are used to communicate about sales promotions?

Answered: 1 week ago

Question

Why do mergers and acquisitions have such an impact on employees?

Answered: 1 week ago

Question

2. Describe the functions of communication

Answered: 1 week ago