Binary Search trees, Tree traversals, Heap Building
part a. 2p
Pick 15 random values from 20 to 90, they should not be in increasing or decreasing order.
You can use an online service such as
https://www.random.org/integers/
where the parameter would be: 15 instead of the value 100 (to generate 15 integers), 20 instead of the value 1 (the value between) and 90 instead of value 100 (the maxvalue) and format in 1 columns.
With these 15 values that should be unique for each student build the binary search tree that results of adding the values to that BST in the order chosen.
Your submission for part a of the assignment should be the sequence of the 15 values and the Binary Search Tree drawn (either by hand and the picture of the tree or drawn in the computer)
part b. 2p
Show the tree traversals for the Binary Search Tree that you built at part a:
give the preorder traversal
give the inorder traversal
give the postorder traversal
give the level order traversal
You submission for part b should be 4 sequences of the 15 values in the correct order corresponding with the 4 tree traversals (corresponding to the BST drawn at part a)
part c. 3p
Consider the 15 values from part a in an array and show the array how it changes for heapification
give each step of the heapification by giving the array side-by-side with the actual heap drawn (see an example in the ppt for week 11 at slide 13 and 14 about adding an entry to the heap)
another example is at slide 25 of the same Week 11 PPT.
The submission for part c should be also hand-written array/heap or computer generated pictures integrated into a PDF/word file.
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.