Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Topic: Data Structures - Trees and Graphs using java language Dear sir, please give me the methods for all of the tasks asked below done

Topic: Data Structures - Trees and Graphs using java language

Dear sir, please give me the methods for all of the tasks asked below done in java language. They are short tasks each will contain in one java class, I will be grateful to you as i dont have any more questions left ,I needed to post all at once, I'm sorry for that. Please do not copy from other chegg solves or resources as it will lead to plagiarism, I will give you big upvote. Take your time, thanks in advance :)

Please provide the screenshots of outputs with code ran in an ide for better understanding, , do not provide handwritten codes please thanks. :)

Instructions that are necessary are in the pic.

Please do it in java. im not familiar with other languages

image text in transcribed

image text in transcribed

(For the below tasks, you may want to create a binary tree manually and use the same tree for all of these tasks. However, for task 6, you need two trees; hence, prepare another) NB: All the methods(1-7) as well as the main method/tester statements must be written in one class. DO NOT write a different class for each method. Compile all your codes and simulation picture in ONE PDF and submit it. 1. RECURSIVELY calculate the height of a tree. 2. RECURSIVELY calculate the level of a Node in a tree. 3. Print elements of all the Nodes of a tree using Pre-order Traversal. 4. Print elements of all the Nodes of a tree using In-order Traversal 5. Print elements of all the Nodes of a tree using Post-order Traversal. 6. Write a method which will evaluate whether two trees are exactly same or not. 7. Write a method which will return a copy (new tree) of a given tree. (For the below tasks, you may want to create a binary tree manually and use the same tree for all of these tasks. However, for task 6, you need two trees; hence, prepare another) NB: All the methods(1-7) as well as the main method/tester statements must be written in one class. DO NOT write a different class for each method. Compile all your codes and simulation picture in ONE PDF and submit it. 1. RECURSIVELY calculate the height of a tree. 2. RECURSIVELY calculate the level of a Node in a tree. 3. Print elements of all the Nodes of a tree using Pre-order Traversal. 4. Print elements of all the Nodes of a tree using In-order Traversal 5. Print elements of all the Nodes of a tree using Post-order Traversal. 6. Write a method which will evaluate whether two trees are exactly same or not. 7. Write a method which will return a copy (new tree) of a given tree

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

Students also viewed these Databases questions

Question

outline some of the current issues facing HR managers

Answered: 1 week ago

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago