Q1. Let consider a queue whose capacity is 6. The given operations are taken out in the sequence as shown:
a) Objects A, B, D, H added
b) An object removed
c) Object I added
d) An object removed
e) Object C added
Illustrate the 5 queue representations after each operation is taken out.
Q2. prepare down a recursive function that computes mn where both m and n are integers.
Q3. Assume that we build the Huffman code tree for the set of letters and frequencies shown below:
Character: A B C D E F
Frequency: 1 5 20 30 40 50
Determine the length of the code for character B?
Q4. An array comprises of n random integers. It is sorted by using merge sort method. Point out the time complexity if this new sorted array is again sorted by using:
a) Merge sort
b) Quick sort
Q5. A sequence S having elements 4, 15, 6, 3, 21 and 2 are given. Insert these elements in the given order to an initially empty Binary Search tree.
Q6. A singly linked list STAR includes an integer in each node. Show how one can delete the first node from this list.