Chat with us, powered by LiveChat ICSI 311 GCU College of Engineering and Applied Sciences Project | excelpaper.org/
+1(978)310-4246 credencewriters@gmail.com
  

Everything is in the PDF document, but let me know if you need any clarification. I just want to reiterate that the program must be written in R5RS Scheme. It will be run/tested using DrRacket.

COLLEGE OF ENGINEERING AND APPLIED SCIENCES
DEPARTMENT OF COMPUTER SCIENCE
ICSI311 Principles of Programming Languages
Assignment 04 Created by Qi Wang
Table of Contents
Part I: General information ………………….………………………………………………………………………………… 02
Part II: Grading Rubric ….………………………………………………………………………………………………………… 03
Part III: Description …………………………….…………………………………………………………………………….……. 03
Part I: General Information

All assignments are individual assignments unless it is notified otherwise.

All assignments must be submitted via Blackboard. No late submissions or e-mail submissions or hard
copies will be accepted.

Unlimited submission attempts will be allowed on Blackboard. Only the last attempt will be graded.

Work will be rejected with no credit if

The work is late.

The work is not submitted properly (Blurry, wrong files, crashed files, files that can’t open, etc.).

The work is a copy or partial copy of others’ work (such as work from another person or the
Internet).

Students must turn in their original work. Any cheating violation will be reported to the college.
Students can help others by sharing ideas and should not allow others to copy their work.


Documents to be submitted:
o Scheme source file(s) with inline comments with file extension .rkt
o Test case document with file extension .PDF
Students are required to submit a design, all the error-free source files with Javadoc style inline
comments and supporting files. Lack of any of the required items or programs with errors will result in
a low credit or no credit.

Grades and feedback: TAs will grade. Feedback and grades for properly submitted work will be posted
on Blackboard. For questions regarding the feedback or the grade, students should reach out to their
TAs first. Students have limited time/days from when a grade is posted to dispute the grade. Check
email daily for the grade review notifications sent from the TAs. Any grade dispute request after the
dispute period will not be considered.
2
Part II: Grading Rubric
See the requirements in part III.
Part III: Description
Goals:



Review and develop a deep and comprehensive understanding of functional programming
Review and develop a deep and comprehensive understanding of the divide-and-conquer technique and
programming technique such as recursion
Review and develop a deep and comprehensive understanding of data structures such as binary search trees
Instructions:
Please read the following requirements carefully. A program that doesn’t meet the following requirements may be
returned with 0 points awarded.
• Use Scheme as a pure functional programming language.
• No built-in functions are allowed. Everything must be written from scratch and by yourself.
• Use recursion, and not iteration.
• Adequate comments must be provided for each logical block in a function for all functions in a program.
• Adequate comments must be provided for the entire program.
• Codes must be formatted properly using indentations to enhance readability.
• The program must be tested completely.
o First, test each function completely.
 Choose two various test cases at least, explain how to arrive at the output.
 List the test cases and their results in comment format at the end of the program (for grading).
 Write the explanations in a separate document using the template provided. You must name
this document using the following naming convention: FirstNameLastNameBSTTestCases and
submit a PDF for this document. A Word template is provided.
o Next, test the entire program by invoking the functions in logical order.
 Choose two various test cases at least, explain how to arrive the output.
 List the test cases and their results in comment format at the end of the program (for grading).
 Add the explanations to the above-mentioned document.
o As mentioned in the previous steps, you must include the test cases and their results at the bottom of
the program in comment format and complete the explanations in the test case document.
 A program without test cases included at the end of program or without test case explanation
document will be returned with 0 points awarded.
 A submission of test case explanation document without the source codes will be returned
with 0 points awarded.
• Submit the program with file extension .rkt and the test case document as a PDF.
Write a program that implements a binary search tree (BST). Assume that a BST organizes integers and can’t contain
duplicate values.
A binary search tree organizes its data by value. Each node n in a binary search tree satisfies the following properties:
• n’s value is greater than all values in its left subtree TL.
• n’s value is less than all values in its right subtree TR.
• Both TL and TR are binary search trees.
A non-empty binary search tree can be represented as a list of three elements – (a value, TL, TR). The first element is a
node’s value(root), the second element is the node’s left subtree, and the third element is a node’s right subtree.
n’s
value
TL
TR
Non-empty left and right subtrees (TL, TR) are binary search trees that are lists of three elements. An empty tree is
represented as an empty list. The following examples show the trees and their list representations. Notice that the list
representations are shown as pseudo codes and may not be in correct Scheme syntax.
60
1
20
40
(1 () ())
(60 (20 () (40 () ()) ) ())
What is the list representation?
The following shows the specifications of BST briefly. When implementing a function, tree status and/or input validation
must be checked as needed.
Construct BST:
• Return an empty BST.
• Given an element, return a new BST contain a node containing the element.
• Given an element, a left subtree, and a right subtree, return a new BST if the three elements are valid, false
otherwise.
Access BST:
• Given a BST, return the root of the tree.
• Given a BST, return the left subtree of the tree.
• Given a BST, return the right subtree of the tree.
Check for Emptiness:
• Given a BST, return true if the tree is empty, false otherwise.
Search:
• Given an element and a BST, return true if the element is in the tree, false otherwise.
Insertion:
• Given an element and a BST, if the element is already in the tree, return the tree. If the element isn’t already in
the tree, return a new binary search tree with the element appearing in its proper location. The original tree
can’t be changed.
BST Traversals:
• Given a BST, return a list containing all values in the tree in the order they are visited in a preorder traversal.
4


Test:
Given a BST, return a list containing all values in the tree in the order they are visited in an inorder traversal.
Given a BST, return a list containing all values in the tree in the order they are visited in a postorder traversal.
Test the design of the entire BST.
5
JOUR463 M 7:00:00 AM 7:05:00 AM
MATH090 M W F 8:00:00 AM 8:50:00 AM
MATH090 T R 3:00:00 PM 4:15:00 PM
MATH095 T R 8:30:00 AM 9:45:00 AM
MATH095 M W F 10:00:00 AM 10:50:00 AM
MATH101 M W F 12:00:00 PM 12:50:00 PM
MATH101 T R 3:00:00 PM 4:15:00 PM
MATH103 T R 11:00:00 AM 12:15:00 PM
MATH103 M W F 12:00:00 PM 12:50:00 PM
MATH104 T R 9:30:00 AM 10:45:00 AM
MATH105 T R 1:30:00 PM 2:45:00 PM
MATH200 T R 9:30:00 AM 10:45:00 AM
MATH200 M W F 3:00:00 PM 3:50:00 PM
MATH205 T R 4:30:00 PM 5:45:00 PM
MATH210 M W F 12:00:00 PM 12:50:00 PM
MATH220 T R 11:00:00 AM 12:15:00 PM
MATH230 M W F 4:00:00 PM 4:50:00 PM
MATH231 T R 1:30:00 PM 2:45:00 PM
MATH240 M W F 9:00:00 AM 9:50:00 AM
MEST101 MTWRF 12:00:00 PM 12:50:00 PM
MEST200 M W F 9:00:00 AM 9:50:00 AM
MEST201 MTWRF 3:00:00 PM 3:50:00 PM
MEST210 T R 4:30:00 PM 5:45:00 PM
MEST301 M W F 8:00:00 AM 8:50:00 AM
MEST315 T R 9:30:00 AM 10:45:00 AM
MEST323 M W F 3:00:00 PM 3:50:00 PM
MEST323 T R 11:00:00 AM 12:15:00 PM
MEST327 M W F 12:00:00 PM 12:50:00 PM
MEST329 T R 11:00:00 AM 12:15:00 PM
MEST329 T R 1:30:00 PM 2:45:00 PM
MEST380 M W F 12:00:00 PM 12:50:00 PM
MGMT201 T R 11:00:00 AM 12:15:00 PM
MGMT201 M W F 5:00:00 PM 5:50:00 PM
MGMT313 T R 9:30:00 AM 10:45:00 AM
MGMT313 T R 1:30:00 PM 2:45:00 PM
MGMT321 T R 1:30:00 PM 2:45:00 PM
MGMT321 M W F 4:00:00 PM 4:50:00 PM
MGMT331 T R 3:00:00 PM 4:15:00 PM
MGMT341 M W F 5:00:00 PM 5:50:00 PM
MGMT401 T R 4:30:00 PM 5:45:00 PM
MGMT431 M W F 12:00:00 PM 12:50:00 PM
MGMT451 M W F 11:00:00 AM 11:50:00 AM
MGMT461 M W F 4:00:00 PM 4:50:00 PM
MGMT499 T R 3:00:00 PM 4:15:00 PM
MGMT499 M W F 3:00:00 PM 3:50:00 PM
MKTG201 M W F 12:00:00 PM 12:50:00 PM
MKTG201 T R 3:00:00 PM 4:15:00 PM
MKTG311 T R 3:00:00 PM 4:15:00 PM
MKTG321 M W F 3:00:00 PM 3:50:00 PM
MKTG361 T R 11:00:00 AM 12:15:00 PM
MKTG371 T R 3:00:00 PM 4:15:00 PM
MKTG401 T R 4:30:00 PM 5:45:00 PM
MKTG471 M W F 10:00:00 AM 10:50:00 AM
PHIL105 T R 9:30:00 AM 10:45:00 AM
PHIL201 M W F 12:00:00 PM 12:50:00 PM
PHIL201 M W F 3:00:00 PM 3:50:00 PM
PHIL222 T R 1:30:00 PM 2:45:00 PM
PHYS201 M W F 10:00:00 AM 10:50:00 AM
PHYS201 M W F 10:00:00 AM 10:50:00 AM
PHYS202 M W F 8:00:00 AM 8:50:00 AM
PHYS202 M W F 8:00:00 AM 8:50:00 AM
POLS200 T R 1:30:00 PM 2:45:00 PM
POLS201 M W F 3:00:00 PM 3:50:00 PM
POLS330 M W F 4:00:00 PM 4:50:00 PM
PSPK101 M W F 10:00:00 AM 10:50:00 AM
PSPK101 T R 11:00:00 AM 12:15:00 PM
PSYC201 M W F 12:00:00 PM 12:50:00 PM
PSYC201 T R 4:00:00 PM 5:15:00 PM
PSYC205 M W F 3:00:00 PM 3:50:00 PM
PSYC305 M W F 10:00:00 AM 10:50:00 AM
PSYC313 M W F 4:00:00 PM 4:50:00 PM
PSYC315 T R 11:00:00 AM 12:15:00 PM
PSYC365 T R 1:30:00 PM 2:45:00 PM
PSYC398 M W F 12:00:00 PM 12:50:00 PM
PSYC411 T R 8:00:00 AM 9:15:00 AM
PSYC440 T R 3:00:00 PM 4:15:00 PM
PSYC450 T R 9:30:00 AM 10:45:00 AM
PSYC498 M W F 3:00:00 PM 3:50:00 PM
QUAN201 M W F 9:00:00 AM 9:50:00 AM
QUAN201 T R 3:00:00 PM 4:15:00 PM
QUAN301 T R 11:00:00 AM 12:15:00 PM
QUAN301 M W F 3:00:00 PM 3:50:00 PM
SCIE201 M W F 4:00:00 PM 4:50:00 PM
SCIE201 T R 1:30:00 PM 2:45:00 PM
SCIE241 T R 9:30:00 AM 10:45:00 AM
SCIE241 M W F 3:00:00 PM 3:50:00 PM
SCIE242 M W F 4:00:00 PM 4:50:00 PM
SCIE251 M W F 3:00:00 PM 3:50:00 PM
SOCI201 T R 10:00:00 AM 11:15:00 AM
SOCI201 M W F 10:00:00 AM 10:50:00 AM
SPAN101 MTWRF 10:00:00 AM 10:50:00 AM
SPAN101 MTWRF 3:00:00 PM 3:50:00 PM
SPAN102 MTWRF 12:00:00 PM 12:50:00 PM
SPAN201 MTWRF 9:00:00 AM 9:50:00 AM
UNIV100 M 1:00:00 PM 1:50:00 PM
UNIV100 W 2:00:00 PM 2:50:00 PM
VCAD301 T R 11:00:00 AM 1:05:00 PM
VCAD302 M W 11:00:00 AM 1:05:00 PM
VCCC100 M W 9:30:00 AM 10:45:00 AM
VCCC101 T R 9:00:00 AM 11:00:00 AM
VCCC101 M W 2:00:00 PM 4:05:00 PM
VCCC102 M W 2:00:00 PM 4:05:00 PM
VCCC104 T R 11:00:00 AM 1:05:00 PM
VCCC105 M W 12:00:00 PM 2:00:00 PM
VCCC204 T R 1:30:00 PM 3:30:00 PM
VCCC205 M W 2:00:00 PM 4:00:00 PM
VCCC205 T R 4:00:00 PM 6:00:00 PM
VCCC480 M W 4:30:00 PM 6:35:00 PM
VCCC480 T R 3:00:00 PM 5:05:00 PM
VCCC485 T R 1:30:00 PM 3:10:00 PM
VCCC490 M 7:00:00 AM 7:05:00 AM
VCDM201 T R 11:00:00 AM 1:05:00 PM
VCDM202 T R 8:00:00 AM 10:00:00 AM
VCDM210 T R 11:00:00 AM 1:00:00 PM
VCDM221 T R 9:00:00 AM 11:00:00 AM
VCDM222 M W 2:00:00 PM 4:00:00 PM
VCDM421 M W 9:00:00 AM 11:00:00 AM
VCGD251 M W 4:00:00 PM 6:00:00 PM
VCGD353 M W 12:00:00 PM 2:00:00 PM
VCGD356 T R 11:00:00 AM 1:00:00 PM
VCGD451 T R 3:00:00 PM 5:05:00 PM
VCST201 M W 9:00:00 AM 11:00:00 AM
VCST211 T R 9:00:00 AM 11:00:00 AM
WLDC201 T R 1:30:00 PM 2:45:00 PM
WLDC201 M W F 11:00:00 AM 11:50:00 AM
WLDC202 T R 3:00:00 PM 4:15:00 PM
WLDC202 M W F 3:00:00 PM 3:50:00 PM

Purchase answer to see full
attachment

error: Content is protected !!