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 in ftp a user jane wants to retrieve an ebcdic file named

1. In FTP, a user (Jane) wants to retrieve an EBCDIC file named huge from /usr/ users/report directory using the ephemeral port 61017. The file is so large that the user wants to compress it before it is transferred. Sho ...

1 implement the delete operation for the avl and 2-3 trees2

1. Implement the delete operation for the AVL and 2-3 trees. 2. Implement the Set ADT using an AVL search tree and evaluate the timecomplexity of each operation. 3. Implement a new version of the Color Histogram ADT to u ...

1 why does the network-layer protocol need to provide

1. Why does the network-layer protocol need to provide packetizing service to the transport layer? Why can't the transport layer send out the segments without encapsulating them in datagrams? 2. Why is routing the respon ...

The section on public key cryptosystems discussed

The section on public key cryptosystems discussed nonrepudiation of origin in the context of public key cryptosystems. Consider a secret key system (in which a shared key is used). Bob has a message that he claims came f ...

1 select two hypervisors on the market today and compare

1. Select two hypervisors on the market today, and compare and contrast how they virtualize and manage the underlying hardware (CPUs and memory). 2. Discuss what changes may be necessary in future multi-core CPU platform ...

Note solving this problem is best done with use of

(Note: solving this problem is best done with use of probability through the level of Markov chains.) You are designing a computer system to control the power grid for the Northeastern United States. If your system goes ...

Assignment reviewing computer operations1 explain why

Assignment: Reviewing Computer Operations 1) Explain why turning off the computer by using the power switch might be harmful to the system. 2) Four medical assistants work at their own computer workstations, which are ne ...

Design an algorithm that reads lines of text reformats it

Design an algorithm that reads lines of text, reformats it and writes it out in pages of two columns (each forty characters wide) separated by a 10-space gap. The first column of the output should correspond to the first ...

Do you feel that social media should be used as a basis for

Do you feel that Social Media should be used as a basis for hiring or firing an employee (why or why not)? Answer in about two paragraphs with reference. Must be 100-200 words and show an understanding and full developme ...

Dbas you continue to review the functionality of various

DB As you continue to review the functionality of various operating systems, you also have to look at various components of the computers to ensure that your selected operating system (OS) is compatible with the hardware ...

  • 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

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

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