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

  Define an information systems security policy

Part 1: define an information systems security policy framework for an it infrastructure

  Physical design and implementation

This assignment requires the use of a relational database management system. Strayer University provides each student with a login id to a University maintained Oracle Database Server for you to implement your tables and queries in this course.

  Differences between the relational database model

What are the key differences between the relational database model and the object-oriented database model? Is one better than the other? Include one example to support your response.Why is it important to weigh database design against implementation?..

  History and implementation of object oriented databases

Write a 3-4 page paper that describes any one of the topics in detail. Include a discussion on the following subject areas and include any graphs.

  How much objective function coefficient decreases

Implement the following LP model in a spreadsheet. Use Solver to solver the problem and create a Sensitivity Report. How much can objective function coefficient for variable X2 decrease before changing optimal solution?

  The concepts of legal writing

In this assignment, we will attemptto utilize some of the concepts of legal writing that we will discuss in class.Below you will find an essay that, to put it mildly, needs a bit of work. Thewording is verbose and uses “slang”. There is no focus or o..

  Customer relationship management (crm) system

All 3 assignments in this unit involve creating and building upon a Customer Relationship  Management (CRM) system for a nation-wide logistics company. In assignment 3 we aim to  link assignments 1 and 2 together in order to add a reb..

  Describe the same task using intelligent software agents

Describe the same task using intelligent software agents

  Explain hardware implementations of intelligent agents

There are hardware implementations of intelligent agents. Determine the literature instances of intelligent agents as software. Compare and contrast two implementations.

  Which access database object asks a question about data

Which Access database object asks a question about the data stored in a database and displays specific fields and records that answer the question?

  Are robots remotely controlled by humans really robots

Are robots remotely controlled by humans really robots?

  The new value for the discountpercent column

Create a trigger named Products_UPDATE that checks the new value for the DiscountPercent column of the Products table. This trigger should raise an appropriate error if the discount percent is greater than 100 or less than 0.

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