0% found this document useful (0 votes)
14 views

Individual Assignment 4

Uploaded by

j6fx8p26m8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Individual Assignment 4

Uploaded by

j6fx8p26m8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment

(Algorithms & Problem Solving)


Spring 2023
Student Information Assignment Information
Student Name Instructor Name Rawand Al-Foqaha’a

LU ID Due date 07/05/2023


CRN 20230 Time 11:59 PM

Problem definition:

Part 1

In the Lecture related to the subject Binary Search Trees, we have looked at
the Algorithm proper to In-order Tree walk, this algorithm is so named
because it prints the key of the root of a subtree between printing the values
in its left subtree and printing those in its right subtree, we have illustrated
it by an example to print the node’s keys in a monotonically increasing
order.

Similarly, a preorder tree walk prints the root before the values in either
subtree, and a postorder tree walk prints the root after the values in its
subtree.

Questions:

1. Write down the recursive algorithms that perform preorder and


postorder tree walks on a tree of nodes. ( 4 Points )
2. Apply in-order, preorder and postorder tree walk on the following
Binary search Tree ( 3 Points)
Part 2

We have studied as well the Algorithm Tree- Successor that looks for the
Successor of a given node, write down the Algorithm for Tree-
predecessor that looks for the predecessor of a given node, use the fact that
tree-predecessor is symmetric to tree- successor to help you in writing down
your solution. ( 3 points )
Document to hand:

You are requested to upload on Black Board a Pdf File containing all the
answers for the above questions.
The due date and time are 07/05/2023 at 11:59 PM.
The Assignment worth 10 Points.

You might also like