Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Computer Engineering Expert

problem 1: Show that we can represent pairs of non-negative integers by using only numbers and arithmetic operations if we represent the pair a and b as the integer that is the product 2a3b. Give the corresponding definitions of procedures cons, car, and cdr.
 
problem 2: Make a Money data structure which is made up of amount and currency.

a) prepare a constructor for this data structure.
 
b) Make accessors for this data structure.

c) prepare operations convert-money (takes a Money object and a currency symbol and returns the Money object of the requested currency), add-money and subtract-money (add and subtract Money objects possibly from various currencies and return a Money object with currency of the first Money object argument).

problem 3: This problem deals with the AVL trees. You should use mutable pairs or lists to implement this data structure:

a) Define a procedure called make-avl-tree that makes an AVL tree with one node. As well create another constructor build-avl-tree which creates an AVL tree from a root, left subtree and right subtree. The constructors return an AVL tree object.
 
b) Make procedures for accessing the root, left subtree and right subtree, and as well mutators for changing the root, left subtree and right subtree of an avl argument.
 
c) prepare a procedure called (insert n t). This procedure consists of 2 arguments: n is the value being inserted and t is the AVL tree.
 
d) prepare a procedure called (lookup n t). This procedure consists of 2 arguments: n is the value being looked up and t is the AVL tree. The subtree with n as its root is returned (or '() if no such node is found).
 
e) prepare a procedure called (print-as-list t). This procedure prints the AVL tree passed in t as a regular list (not a mutable list).
 
f) prepare down a procedure called (print-inorder t). This procedure prints the AVL tree passed in t in inorder traversal form.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91840

Have any Question? 


Related Questions in Computer Engineering

1 design implement and test a computer program to simulate

1. Design, implement, and test a computer program to simulate a telephone customer service center. Your simulation should evaluate the average time customers have to wait on hold. 2. Design, implement, and test a compute ...

Describe two types of variables or methods that can be used

Describe two types of variables or methods that can be used to exchange data between web pages and give example code of both types.

1 your job is to cook 3 cakes as efficiently as possible

1. Your job is to cook 3 cakes as efficiently as possible. Assuming that you only have one oven large enough to hold one cake, one large bowl, one cake pan, and one mixer, come up with a schedule to make three cakes as q ...

Nutty hospital wishes to advance-refund its existing 15

Nutty Hospital wishes to advance-refund its existing 15% long-term debt. The present $30,000,000 is not callable until 5 years from today. The payout on the issue over the next 5 years is as presented in table 21-14. At ...

Assume that our network never corrupts loses or duplicates

Assume that our network never corrupts, loses, or duplicates packets. We are only concerned about flow control. We do not want the sender to overwhelm the receiver with packets. Design an FSM to allow the sender to send ...

1 determine the picker route in the storage zone of the

1. Determine the picker route in the storage zone of the French warehouse of the Guillen company (see given figure), using the S-shaped heuristic, the largest gap heuristic, the combined heuristic and the aisle-by-aisle ...

1 ticketsrus needs an application to calculate ticket

1. TicketsRUs needs an application to calculate ticket prices. There are three ticket prices: • Orchestra $85 each • Mezzanine $70 each • Balcony $45 each There is also a 15% discount on matinee performances. Your applic ...

1 list and describe the four primary types of ups systems

1. List and describe the four primary types of UPS systems. Which is the most effective and the most expensive, and why? 2. What two critical functions are impaired when water is not available in a facility? Why are thes ...

1 what is security and information security what is the

1. What is security and information security? What is the difference? 2. It has been stated that security is a continuous process; what are the states in this process? 3. What are the differences between symmetric and as ...

Assignmentin preparation for more complex data processing

Assignment In preparation for more complex data processing tasks using object oriented objects that you will create in up-coming units, in this unit you will utilize arrays to build some basic processing logic and struct ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen