Assigning the inorder traversal number

Assignment Help Basic Computer Science
Reference no: EM13968094

The larger binary trees in this chapter were generated automatically by a program. This was done by assigning an (xy) coordinate to each tree node, drawing a circle around each coordinate (this is hard to see in some pictures), and connecting each node to its parent. Assume you have a binary search tree stored in memory (perhaps generated by one of the routines above) and that each node has two extra ?elds to store the coordinates.

a. The coordinate can be computed by assigning the inorder traversal number. Write a routine to do this for each node in the tree.

b. The coordinate can be computed by using the negative of the depth of the node. Write a routine to do this for each node in the tree.

c. In terms of some imaginary unit, what will the dimensions of the picture be? How can you adjust the units so that the tree is always roughly two-thirds as high as it is wide?

d. Prove that using this system no lines cross, and that for any node, X, all elements in X's left subtree appear to the left of and all elements in X's right subtree appear to the right of X.

Reference no: EM13968094

Questions Cloud

What is the distance between the observer : What is the distance between the observer and Q? 2) how much elevation did the plane gain between P and Q?
Nodes of a binary tree in level-order : 1. Write a routine to list out the nodes of a binary tree in level-order. List the root, then nodes at depth 1, followed by nodes at depth 2, and so on. You must do this in linear time. Prove your time bound.
General-purpose tree-drawing program : Write a general-purpose tree-drawing program that will convert a tree into the following graph-assembler instructions:
Find the profit from operating the shop : Also, the shop will lose $75 per day at a sales level of x=0. Find the profit from operating the shop at a sales level of x ties per day.
Assigning the inorder traversal number : a. The x coordinate can be computed by assigning the inorder traversal number. Write a routine to do this for each node in the tree. b. The y coordinate can be computed by using the negative of the depth of the node. Write a routine to do this for ea..
How do you think twitter uses a data warehouse : Do you agree that a business can use Twitter to gain business intelligence? How many companies do you think are aware of Twitter and exactly how they can use it to gain BI? How do you think Twitter uses a data warehouse?
Who do you think uses internet dating services : Internet dating services, while becoming very popular, may present some dangers for those who use their services. Who do you think uses Internet dating services? What, if anything, should dating services do to protect their clients
What employers are looking for attributes of professionalism : Fill the 7 attributes above with examples. Cross reference the 6 items what employers are looking for above with the 7 attributes of professionalism.
Find the amount of discrepancy the speaker : Find the amount of discrepancy the speaker should aim for to maximize the attitude change in the audience.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Perform a risk assessment of teller-s computer

Tellers at each branch use a four-digit numeric password, and each teller's computer is transaction-coded to accept only its authorized transactions. Perform a risk assessment.

  Dentist-patient appointment data

The table shown below lists dentist-patient appointment data. A patient is given an appointment at a specific time and date with a dentist located at a particular surgery. On each day of patient appointments, a dentist is allocated to a specific..

  How does the use of the internet, intranets, and extranets

How does the use of the Internet, intranets, and extranets by companies today support their business processes and activities

  Calculate a 10% commission of an item price when sold

Enter a bid for an item and the bids are stored in an STL priority_queue object. This allows the highest bid to be at front of the queue.

  Learn the combined use of timer and the tracking of user

Lab 10 - The Student Game - Learn the Combined use of Timer and the tracking of user interactions Deliverables app.java, myJFrame.java, myJPanel.java, and other necessary Java files

  Determining smallest-last vertex ordering

Determine a smallest-last vertex ordering and plot degree when deleted diagram for given random geometric graphs.

  Evaluating options and developing resolutions

Provide an overview of tasks and key work activities (meetings, training, presentations, etc.) in which you were engaged during the week, with sufficient detail for your instructor to understand what you were involved in.

  Growth in global business activity affects

Growth in global business activity affects how employees and associates from different organizations and within the same organization network with each other. Use the internet to research how you might successfully network with peers in other countri..

  How the data block information is managed using fat

File X has 15 data blocks. The block addresses of the 15 blocks are 8, 9, 10, 11, 12, 13, 5, 4, 21, 22, 23, 24, 25, 26 and 27.

  A change to my coin tossing program

A change to my Coin Tossing program

  Compare and contrast frameworks

Compare and contrast the 3 selected frameworks

  Write a one-page paper describing these new activities

Propose three to five additional activities you think should be added to a Gantt chart to help you estimate resources and durations. Write a one-page paper describing these new activities.

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