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

Add a time deposit account class to the bank account

Add a Time Deposit Account class to the bank account hierarchy. The time deposit account is just like a savings account, but you promise to leave the money in the account for a particular number of months, and there is a ...

Describe the facilitators role in a virtual team what tools

Describe the Facilitator's Role in a virtual team. What tools can a facilitator use to ensure High Impact Virtual Meeting? What are the keys to giving/ receiving constructive feedback? How is feedback different in a one- ...

1 ideally a method should have no side effects can you

1. Ideally, a method should have no side effects. Can you write a program in which no method has a side effect? Would such a program be useful? 2. Write preconditions for the following methods. Do not implement the metho ...

Part 1 the heap classcreate a java class for the max heap

Part 1: The Heap Class Create a Java class for the Max Heap data structure. Implement the heap as an array. You will needto keep track of the heap size with a private variable. Implement an adequate constructor and agett ...

One of the objects groups that can be managed is the ip

One of the objects (groups) that can be managed is the ip group with the object identifier (1.3.6.1.2.1.4) in which (1.3.6.1.2.1) is the identifier of MIB-2 and (4) defines the ip group. In an agent, this object has 20 s ...

Frans virtual fruit standpart 1frans virtual fruit stand is

Fran's Virtual Fruit Stand, Part 1 Fran's Virtual Fruit Stand is an online store that sells several types of dried fruit. Based on the needs of Fran's Virtual Fruit stand, you must design a flowchart using Visual Logic. ...

1 does the rapid development of computer technology put any

1. Does the rapid development of computer technology put any strain on the existing criteria for updates? 2. Study and compare TCSEC, ITSEC, and CC assurance levels. 3. Trace the evolution of the security evaluation crit ...

Create a view integration to represent the combination

Create a View Integration to represent the combination between the conversion process with the acquisition payment, human resource and revenue process based on the REA patterns described on the textbook and slides for ea ...

Assume that you have been hired to manage a large domestic

Assume that you have been hired to manage a large domestic and foreign information system. what are some of the issues and solution that you would discuss and plan.

1 what is tombstoning and why use it2 discuss in detail

1. What is tombstoning and why use it? 2. Discuss in detail Idle Detection in Windows Phone 8 Applications. 3. Discuss in detail the software input panel (SIP). 4. Discuss Data Binding. 5. Discuss the Windows Phone Toolk ...

  • 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