Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Data structure with JAVA Chapter : Symbol Table Read Algorithms 3 . 1 , 3 . 5 and 3 . 2 Recursion Supplement ( Optional

Data structure with JAVA
Chapter : Symbol Table
Read Algorithms 3.1,3.5 and 3.2
Recursion Supplement (Optional, but suggested): Tracing Recursion. You do not need to hand in anything for this.
Do the following problems from the text. (Hand in.)
3.1.10
Give a trace of the process of inserting the keys
E A S Y Q U E S T I O N
into an initially empty table using SequentialSearchST. How many
compares (of keys) are involved?
3.1.11
Give a trace of the process of inserting the keys
E A S Y Q U E S T I O N
into an initially empty table using BinarySearchST. How many
compares (of keys) are involved?
3.2.1
Draw the BST that results when you insert the keys
E A S Y Q U E S T I O N
in that order (associating the value i with the ith key, as per
the convention in the text) into an initially empty tree. How many
compares are needed to build the tree?
3.2.2
Inserting the keys in the order A X C S E R H into an
initially empty BST gives a worst-case tree where every node has one
null link, except one at the bottom, which has two null links. Give
five other orderings of these keys that produce worst-case trees.
You can also describe the constraints that produce this outcome
--- Things like "insert A first, insert B before C, etc."
3.2.3
Give five orderings of the keys A X C S E R H that, when
inserted into an initially empty BST, produce the best-case tree.
You can also describe the constraints that produce this outcome
--- Things like "insert A first, insert B before C, etc."
3.2.4
Suppose that a certain BST has keys that are integers between
1 and 10, and we search for 5. Which sequence below cannot be the
sequence of keys examined?
a.10,9,8,7,6,5
b.4,10,8,6,5
c.1,10,2,9,3,8,4,7,6,5
d.2,7,3,8,4,5
e.1,2,10,4,8,5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions