What is the height of the tree

Assignment Help JAVA Programming
Reference no: EM132057151

Assume that you have a complete tree with 200 nodes, and that you represent it in array form.

1. Node A of the tree is in position 50 of the array. What are the indices of A's left child, right child, and parent? Explain how you got your answers.

2. What is the height of the tree? Explain your answer briefly.

3. The bottom level of the tree contains some number of leaf nodes. Is the rightmost leaf node in the bottom level the left child of its parent or the right child of its parent? Explain your answer briefly.

4. In Problem 6, you will implement a method that determines if the complete tree corresponding to an array of values is a heap. What is the efficiency of determining if an array of length n represents a heap in the best case? In the worst case? Use big-O notation, and explain your answers briefly.

Reference no: EM132057151

Questions Cloud

How to establish a connection using the latter approach : Compare the classes and the functionality provided by the Java API NIO and the combination of the packages java.io and java.net.
How to create class named delivery details : How to create class named Delivery_Details that will contain get and set methods for the town, weight, price and delivery company
Determine the wilsons time-weighted rate of return : On the following January 1, his fund balance is $3700. What is Wilson's time-weighted rate of return?
Two types of java exceptions : In this discussion, please provide at least two types of Java exceptions that can be thrown in a Java application.
What is the height of the tree : Assume that you have a complete tree with 200 nodes, and that you represent it in array form. What is the height of the tree? Explain your answer briefly.
Determine the price per share of wilson inc : The firm's debt consists of 20,000 bonds that are currently trading at a price of $1,038.75 each ($20,775,000 debt).
Dealership as a vehicle inventory program : Create an automobile class that will be used by a dealership as a vehicle inventory program. The following attributes should be present in your automobile class
Determine what will a share of stock sell for today : If the required return on Storico stock is 12 percent, what will a share of stock sell for today?
Identify three business risks that are faced by williams : Identify three business risks that are faced by Williams with respect to production processes and inventories.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write program that play rock-paper-scissors-lizardspock game

Write a program that plays the Rock-Paper-Scissors-Lizard-Spock game. Refer to http://en.wikipedia.org/wiki/Rock-paper-scissors-lizard-Spock for more information.

  Create a gui to display the structure

Read a data file, create the internal data structure, create a GUI to display the structure, and let the user search the structure. Sort the structure, use hash maps to create the structure more efficiently.

  Initialize the array with the appropriate number of values

Initialize the array with the appropriate number of values. What is the value in the array element when the index contains 2? What is your list length

  Carry out additions and subtraction

You are to design a Java application to carry out additions and subtractions for numbers of any length. A number is represented as an object which includes a sign and two strings for the whole and decimal parts of the number.

  Describe your methodology and service level agreements

How often do you have down time? How often do you upgrade software/hardware? Describe your methodology and service level agreements.

  Write a program that displays a string welcome to java

Write a program that displays a string Welcome to Java around the circle, as shown in Figure

  Implement a javascript program for the validation case

Write a JavaScript program for the validation case using the RegExp method - implement a JavaScript program for the validation case

  Write a script that inputs several lines of text

Write a script that inputs several lines of text and a search character and uses String method indexOf to determine the number of occurrences of the character in the text.

  Create a japplet that contains a jlabel and jbutton

Create a JApplet that contains a JLabel and JButton -  create an HTML document to host the applet, set the Width to 450 and the Height to 200. Save as TestJChangeFont.html.

  Write a program called split in java that reads a text file

Write a program called Split in Java that reads a text file, in.txt, that contains a list of positive integers (duplicates are possible, zero is not considered a positive integer) separated by spaces and/or line breaks.

  How to link different classes forms

How to link different classes forms. When a person clicks on A, B, or C the program will go to the addEmployee form or Punch In/Out form in Java.

  Identify which share stock they wish to trade

300581 - Programming Techniques - Identify which share stock they wish to trade. If the customer already owns shares in the chosen company then shares

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd