Define a procedure called make-avl-tree, Data Structure & Algorithms

This question deals with AVL trees. You must use mutable pairs/lists to implement this data structure:

(a) Define a procedure called make-avl-tree which makes an AVL tree with one node. Also create another constructor build-avl-tree that creates an AVL tree from a root, left subtree and right subtree. The constructors return an AVL tree object.

(b) Create procedures for accessing the root, left subtree and right subtree, and also mutators for changing the root, left subtree and right subtree of an avl argument.

(c) Write a procedure called (insert n t). This procedure has 2 arguments: n is the value being inserted, t is the AVL tree.

(d) Write a procedure called (lookup n t). This procedure has 2 arguments: n is the value being looked up, t is the AVL tree. The subtree with n as its root is returned (or '() if no such node is found).

(e) Write 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) Write a procedure called (print-inorder t). This procedure prints the AVL tree passed in t in inorder traversal form.

Posted Date: 3/28/2013 3:44:36 AM | Location : United States







Related Discussions:- Define a procedure called make-avl-tree, Assignment Help, Ask Question on Define a procedure called make-avl-tree, Get Answer, Expert's Help, Define a procedure called make-avl-tree Discussions

Write discussion on Define a procedure called make-avl-tree
Your posts are moderated
Related Questions
Explain the halting problem Given a computer program and an input to it, verify whether the program will halt on that input or continue working indefinitely on it.

Beauty Salon is a system to be designed to manage the booking and the payment of a single beauty parlour. Beauty Therapists: A beauty parlour has a number of staff members mo

Column Major Representation In memory the second method of representing two-dimensional array is the column major representation. Under this illustration, the first column of

For the Oscillating sort to be applied, it is necessary for the tapes to be readable in both directions and able to be quickly reversed. The oscillating sort is superior to the po

algorithm of output restricted queue.

Ask question #Minimum 10000 words accepted#

I was wanting to know where this web site was created. My second question is,,, are the online tuters accredited teachers? If they are, are they only working for the website or ma


Binary search tree. A binary search tree is a binary tree that is either empty or in which every node having a key that satisfies the following conditions: - All keys (if an

using a program flowchart design a program to illustrate pop and push operation