Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

BinaryTree: https://mega.nz/#!Y2RSkQJK!TONmaKvU9mmT0UaQOQQ7xXAsycEKWJjXQcU2lXghvgY This has a main method with the test code inside. Tasks Create a class called Binary Tree. BinaryTree should have the following fields

BinaryTree: https://mega.nz/#!Y2RSkQJK!TONmaKvU9mmT0UaQOQQ7xXAsycEKWJjXQcU2lXghvgY

This has a main method with the test code inside.

image text in transcribed

Tasks Create a class called Binary Tree. BinaryTree should have the following fields and methods. Binary- 1. a constant BinaryTree called EMPTYTREE with a default key value and null children 2. an integer field called key 3. a Binary Tree field called leftChild 4. a Binary Tree field called rightChild 5. a constructor taking three arguments and initializing the appropriate fields 6. an insert method taking an integer parameter and returning a new BinaryTree with the given integer inserted 7. a find method taking an integer parameter and rcturning the (sub) tree containing the given integer as its data 8. a printPreOrder method taking no parameters and printing out the data in the tree in pre-order 9. a printinOrder method taking no parameters and printing out the data in the tree in in-order 10. a printPostOrder method taking no parameters and printing out the data in the tree in post

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions