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

The farmworker movement documentation project founded in

The Farmworker Movement Documentation Project, founded in 2003 by LeRoy Chatfield, is a labor of love. The project seeks to compile and publish primary source accounts from the volunteers who worked with Cesar Chavez to ...

1 research and develop a comprehensive list of the current

1. Research and develop a comprehensive list of the current known viruses. 2. Research, find, and study a virus code. Write an antivirus for that code. 3. Look at a popular application such as PowerPoint or Excel. Find a ...

1 there are evaluated computer products on the market find

1. There are evaluated computer products on the market. Find out how one finds out whether a computer product has a security evaluation. 2. If you have a computer product, how do you get it evaluated? Does the evaluation ...

To make the initial sequence number a random number most

To make the initial sequence number a random number, most systems start the counter at 1 during bootstrap and increment the counter by 64,000 every half second. How long does it take for the counter to wrap around?

Write a windows application that allows the user to explore

Write a Windows application that allows the user to explore the knapsack problem. The user should be able to change the capacity of the knapsack, the sizes of the items, and the values of the items. The user should also ...

Question 1 an example of the neuron model is the sigmoid

Question 1. An example of the neuron model is the sigmoid function which is defined by: φ(v)=1/(1+exp?(-v)) For this problem, you need to prove that (∂φ(v))/∂v=φ(v)(1-φ(v)) Question 2. Consider the following cost functio ...

Line segment informationthis program allows the user to

Line Segment Information This program allows the user to draw a line segment and then displays some graphical and textual information about the line segment. Input: 2 mouse clicks for the end points of the line segment. ...

Design and implement a left and right justification

Design and implement a left and right justification algorithm that inserts extra spaces after the longest word first, then after the second longest word and so on. In your implementation by making certain assumptions, tr ...

1 discuss the concept of global privilege does it work well

1. Discuss the concept of global privilege. Does it work well in a distributed authorization or centralized authorization? 2. With the principle of "least privileged," is it possible to have too much authorization? What ...

Write your own bitarray class without inheriting from the

Write your own BitArray class (without inheriting from the BitArray class) that includes a conversion method that takes Boolean values and converts them to bit values. Hint: use a BitArray as the main data structure of t ...

  • 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