Submit: Turn in your hw4.uscm
source file
using the turnin command
on morbius.mscsnet.mu.edu or one of the
other Systems
Lab machines.
Work is to be completed in teams of two. Be certain to include both teammates names in the file. You may submit multiple times, but only the last turnin will be kept. The automatic submission system will not accept work after the deadline.
This assignment makes use of the Binary Tree Demo from class. To use these definitions for your assignment, copy the ~brylow/cosc3410/demo/tree-manual.uscm source file into the same directory as your hw4.uscm file. Include at the top of your file:
(use tree-manual.uscm)
Do not turnin (use tree-manual.uscm) with your assignment; I will provide my own copy when grading.
Write a function path that given an integer and a sorted binary tree of integers, returns a list of the turns that must be taken to reach the integer from the root, or #f if the element does not exist in the tree.
path : Int x BinaryTree(Int) → S-List
Usage: (path n t) = lst, a list of lefts and rights showing how to re
ach the node in t that contains n.
This problem relies upon the binary tree demonstration from lecture. See abo
ve.
Chapter 2.16.5, exercise 11. Write inorder and postorder, but use the manually defined tree data structure from class, as above.
Examples:Chapter 2.16.2, exercise 2.
Chapter 2.16.2, exercise 5.
Chapter 2.16.4, exercise 8.
[Revised 2023 Oct 02 13:56 DWB]