Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pls do in java Here is BST code: public class BST{ BSTNode root; //Constructor public BST(){ root=null; } //Method to serach a key public boolean

Pls do in java

image text in transcribed

Here is BST code:

public class BST{ BSTNode root; //Constructor public BST(){ root=null; } //Method to serach a key public boolean search(int k){ BSTNode cur=null; while(cur!=null){ if(cur.key==k) return true; else if(k

--------------------------

public class BSTNode{ int key; BSTNode left; BSTNode right; //Constructor public BSTNode(int k){ key=k; left=null; right=null; } }

Here is BST code:

public class BST{ BSTNode root; //Constructor public BST(){ root=null; } //Method to serach a key public boolean search(int k){ BSTNode cur=null; while(cur!=null){ if(cur.key==k) return true; else if(k

--------------------------

public class BSTNode{ int key; BSTNode left; BSTNode right; //Constructor public BSTNode(int k){ key=k; left=null; right=null; } }

d Add a function public void remove(int k) to the BST class. e Let n denote the number of nodes. Construct binary search trees for n-10, ?-100, ? 500, ?-1000, ?-2000, ?-5000, ?-10000, n = 100000, n-1000000. For each n you will pick uniformly random times and calculate the average height of the tree for each n. constants that relate the average height to?log2(n+ 1)1-1 for each in the range [-2",21. or each n f Compare the average height to ?10g2(n + 1)-1 for each n. Calculate n. Is there any relationship betweens constants for each n

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions