Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Binary Trees JAVA I have some question about Binary Trees in Java, I need helping answering them, thank you! Java Trees Questions: Q1. (a) What

Binary Trees JAVA

I have some question about Binary Trees in Java, I need helping answering them, thank you!

Java Trees Questions:

Q1. (a) What is the height of the shortest binary tree that contains 22 * nodes? (b) Is this tree full? (c) Is it balanced? * * A1. (a) * (b) * (c) * ========================================================================= * Q2. Consider a binary tree that has four levels. * (a) What is the maximum number of nodes in this tree? * (b) What is the maximum number of leaves in this tree? * * A2. (a) * (b) * ========================================================================= * Q3. Consider a traversal of a binary tree, which contains Integer data. * Suppose that visiting a node means to simply display the data in the * node. What are the results of each of the following traversals of the * binary tree shown in Figure 1. * (a) Preorder * (b) Postorder * (c) Inorder * (d) Level order * * A3. (a) * (b) * (c) * (d) * * ========================================================================= * Q4. Repeat Q3 but for the binary tree shwn in Figure 2. * A4. (a) * (b) * (c) * (d) * * ========================================================================= * Q5. The two binary trees shown in Figures 1 and 2 contain Integer data. * (a) Is the tree in Figure 1 a binary search tree? Why or why not? * (b) Is the tree in Figure 2 a maxheap? Why or why not? * * A5. (a) * (b) * * ========================================================================= * Q6. Can a binary search tree ever be a maxheap? Explain. * A6.

image text in transcribed

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

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

Different formulas for mathematical core areas.

Answered: 1 week ago