Question: I was required to improve range Search function in BST's Big-O by adding additional information to tree nodes. that improvement increases Big-O to O(h), h

I was required to improve range Search function in BST's Big-O by adding additional information to tree nodes.

that improvement increases Big-O to O(h), h is height and

additional information should be added and subtracted by inserting and deleting nodes.

therefore, We needs to modify BST's insert and delete algorithm.

under, there are rangeSearch,Insert,Delete function's declaration and function description.

range search function is

int rangeSearch(Tree T,int a,int b)

that counts the number between a to b in tree.

Insert function is

Node insert(Node n,Element e)

that inserts Element e in Node n.

Delete function is

Node Delete(Node n,Element e)

that deletes Node n which has element e.

finally, I really hope to be given answer is what should be added in tree node.

and if you give me the answer through C programming, I am really glad !!

please give me clear answer !!

and if you need more information, please let me know what information you want.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!