Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. 2. 3. (a) What is the average cost of find on a binary search tree generated by the insertion of the elements: 9,7, 12,

1. image text in transcribed 2.

image text in transcribed 3.

image text in transcribed

image text in transcribed

(a) What is the average cost of find on a binary search tree generated by the insertion of the elements: 9,7, 12, 10, 3, 11,6, 4,8 into an empty tree. Show your working. (b) Write down six insertion orders of the numbers in the set: 1,2,3,4 That will create a degenerated binary search tree. Hint a degenerated binary search tree is one of maximal depth for its number of elements. (c) Prove by induction that a tree with n nodes has n-1 edges. (d) Draw a sequence of diagrams showing the insertion of the values: [13,11, 9,27,19,21,3] into an empty AVL tree. You must: Show the resulting tree immediately after each insertion step (that is before any balancing has taken place) Indicate the node(s) at which each rotation is performed. Where there is a double rotation, show the tree after each single rotation. Show the resulting tree after balancing operation(s)

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions