Algorithms question in Java : Do not use built-in functions or classes of JAVA. This question
Question:
Algorithms question in Java: Do not use built-in functions or classes of JAVA.
This question is designed similarly to a job interview. First, we will introduce a problem. You then
need to apply critical thinking, design a solution, evaluate the solution (Big-O), then improve it if needed.
Lastly, you will implement your solution.
detailed comments will be much appreciated, thanks!
# In the instructions, there is a mistake. The methods setLeft, and setRight have 2 input arguments each (of Worker type). In the instructions, it is stated that they have one input argument p. For example, for the setLeft method, 2 input arguments of the Worker type are required, one as the root and one as the left child.
# The signature of the methods described in the tables of instructions includes the word "static". Implementing the methods as static is not required, and only the name of the method needs to be the exact same.
# For the SetLeft method, 2 input arguments of the Worker type are required. Just be careful that the root here does not refer to the root of the tree and rather the root of the sub-tree you are adding the child to.
# The idea is that you should have a general tree with many children but for simplicity of it, we are using only binary tree. setRight, setLeft methods Do not need to return anything. For size, it should return the number of nodes in the tree --- n
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr