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

While passwords generally have few restrictions they are

While passwords generally have few restrictions, they are normally not totally free. Suppose that in a certain system passwords can be of arbitrary length, but must contain at least one letter,a:::z and one number 0:::9. ...

A glass has the shape of a truncated cone of height 5

A glass has the shape of a truncated cone of height 5 inches. Its top diameter is 3.5 inches and its base diameter is 2 inches. If water is poured into the glass at 2 gallons per minute, write a script to calculate how l ...

Explain the relationships among the following words system

Explain the relationships among the following words: system, environment, boundary, and interface.

A what does ddl stand for list the sql ddl statementsb what

a. What does DDL stand for? List the SQL DDL statements. b. What do es DML stand for? List the SQL DML statements. c. Explain the meaning of the following expression: IDENTITY (4000, 5). d. Write a CREATE TABLE statement ...

What are we talking about in practice when it comes to

What are we talking about in practice when it comes to organize resources, control the results, and ensure expectations are being met?

A program written for personal use imposes rather less

A program written for personal use imposes rather less stringent requirements than a product that is also to be used by other people. According to (Brooks, 1995), the latter may require three times as much effort. Discus ...

1 consider a project that costs 10000 today it will provide

1. Consider a project that costs $10000 today. It will provide benefits of $4000 at the end of year1, $3500 at the end of year2, and 3500$ at the year of year3. If the discount rate is 6 percent, will this project be app ...

An extreme method of spooling known as staging a tape is to

An extreme method of spooling, known as staging a tape, is to read the entire contents of a magnetic tape onto disk before using it. Discuss the main advantage of such a scheme

Reanalyze the final nonrecursive model of turnover

Reanalyze the final nonrecursive model of turnover intention (see Figure 14.2 for the initial model) by constraining to equality the direct effects of the feedback loop. Compare the unstandardized and standardized coeffi ...

Last year berkeley ca passed a tax on yoga classes of 4 per

Last year, Berkeley, CA passed a tax on yoga classes of $4 per yoga class.  Suppose that the pre-tax demand for yoga classes is QD = 2000 - 100P, and that the pre-tax supply of yoga classes is QS = 300P -200. (a) Calcula ...

  • 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

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate