Question: ( 1 ) Given two arrays A [ 0 . . n 1 ] and B [ 0 . . n 1 ] of numbers.
Given two arrays An and Bn of numbers. Find their
intersection set, ie the set that contains those numbers that are both in A and B A
bruteforce algorithm would be easy: for each number in A check to see whether it is
in B
a Analyze the time complexity of the bruteforce algorithm for solving the problem.
b Design a presortingbased algorithm for solving the problem and analyze its
complexity.
You are given a dictionary, in which each word can have a maximum of
letters. This assumption is unrealistic. Design a presortingbased algorithm to find
all sets of anagrams. For example, eat, ate and tea belong to the same anagram set.
Analyze the complexity of your algorithm.
For the following list of numbers, construct an AVL tree by inserting them,
one by one successively, into an empty tree:
Deletion is another operation that could cause an AVL tree to be
unbalanced. Suppose that you are given a pointer pointing to the node to be deleted.
Discuss what you should do in order to make sure that, after deleting the node, the
tree is still AVL.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
