Question
Design algorithms for the following functions and describe them in pseudocode. If you use auxiliary functions, describe them in pseudocode as well. Evaluate the runtime
Design algorithms for the following functions and describe them in pseudocode. If you use auxiliary functions, describe them in pseudocode as well. Evaluate the runtime efficiency of your algorithms and express it in O( ) notation.
a. Union(T1.root, T2.root): T1.root and T2.root point to the roots of two B-trees. The function returns a pointer to the root of a B-tree containing every key contained in T1 or T2.
b. Intersection(T1.root, T2.root): T1.root and T2.root point to the roots of two B-trees. The function returns a pointer to the root of a B-tree containing every key contained in both of T1 and T2. Assume that every key value is unique in both T1 and T2.
Both Union and Intersection functions will keep T1 and T2 trees intact.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started