ASSIGNMENTS Chapter Q. No. Questions Course Outcom e (CO) Progra m Outcom e I 1 If f(n) = Θ(g(n)) and g(n)= Θ(h(n)), then proof that h(n) = Θ(f(n))
2 3. What is the time complexity of the algorithm?
4 CO2 What is the return value of the function? 5 Define an algorithm? 6 List the characteristics of an algorithm. 7 Write about the principle of optimality? PO8 8 Can you find big oh value mathematically for the given function: Proof that 100n+5=O(n 2 ) 9 What is Time Complexity and Space Complexity? 10 Write down the use of asymptotic notations. 1 How do we use stack in solving recursion? 2 Show how 64 disks are shifted to destination using tower of Hanoi? 3 How a stack works as abstract data type? 4 How do we evaluate the following postfix expression with the help of suitable data structure? P: 3,16,2,+,*,12,6,/,- (commas are used as separator), II 5 When should the push () stop working? 6 Convert the following infix expressions into its prefix expression using a stack (A + B * C) * (M * N ^ P + T)- G + H
7 What about the range of the pointer top? 8 State how the initial position of the top pointer matters in pushing elements on to the empty stack. 9 If the position of top is at -1, state how pop () will work here? 10 for (i=0; i<=stacksize; i++) printf ( %d, stack[i]); PO 3 PO 3, Will it print the stack? State the problem with this code if there is a single element present on a stack of size 100. 1 Why queue is useful? 2 How can we delete the first element from the queue?, III 3 When an element is added to the deque with n memory cells, what happens to LEFT or RIGHT? 4 Can circular queue overcome the problems of simple queue?, 5 Which are the areas where we use circular queue? 6 What will be the problem for a circular queue if we simply increment rear pointer by 1? 7 How can we delete elements from circular queue? 8 Do we really need de-queue?,
IV 9 How a priority queue is organized? 10 How can a priority queue help in tree data structure? 1 How can we sort a single linked list? 2 How linked list is better than array? 3 Divide a single linked list from its middle position.,,, 4 Can we append any element at the end of a double linked list? 5 Solve Josephus problem. 6 What are the applications of a circular linked list? 7 Is double linked list useful? 8 How linked list is useful in representing a sparse matrix? 9 How can the polynomial 6x3 +9x2 +7x +1 be represented in the memory using a linked list? 10 Can we add two polynomials using linked list?,, 1 Calculate the total number of nodes of a complete binary tree with depth d. 2 Can we construct a binary search tree with the help of
the following expressions? Preorder: A B D G H K C E F V Inorder: G K H D B E F C A 3 Write the recursive algorithms for in-order and postorder binary tree traversal. 4 For a strictly binary tree, calculate the intermediate nodes if the number of leaves is n. 5 Given the expression, Exp = a+b/c*d-e, construct the corresponding binary tree. CO 3 CO 3 6 How threads work in a full threaded binary tree? 7 Is this possible to construct an AVL tree from the following data 55, 66, 77, 15, 11, 33, 22, 35, 25, 44, 88, 99? Show the final tree. 8 Is B tree a binary tree? Why a B tree is useful? CO2 9 Show how a max heap can be helpful in sorting these elements. 9, 6, 8, 7, 21, 14, 15, 19, 13, 12 10 How the terminal nodes of a B + tree will look like with the following inputs? a n b o z c p d r q u s e t f h i g w j y v k m l x 1 Illustrate the Floyd Warshall algorithm with suitable example. 2 Explain the relationship between a linked list structure and a digraph. VI 3 When is a spanning tree called a minimum spanning tree? Take a weighted graph of your choice and find out its minimum spanning tree. 4 Differentiate between depth-first search and breadthfirst search traversal of a graph. CO2 5 Briefly discuss Warshall s algorithm. Also, discuss its modified version.
6 Given the adjacency matrix of a graph, write a program to calculate the degree of a node N in the graph. 7 What is greedy algorithm? 8 Classify degree of a graph? 9 Explain the path and adjacency multi-list. 10 Explain representations of the path and adjacency multilist graph with example. 1 The keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of length 10 using open addressing with hash function h(k) = k mod 10 and linear probing. What is the resultant hash table? VII 2 Consider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions? 3 Consider a hash function that distributes keys uniformly. The hash table size is 20. After hashing of how many keys will the probability that any new key hashed collides with an existing one exceed 0.5? 4 What is linear probing in hashing? 5 Show insertion of elements {4371, 1323, 6173, 4199, 4344, 9679, 1949} in a hash table if size 10 where hash function h(x) = x mod 10 and collision resolution technique is quadratic probing. 6 What do you mean by collision resolution? 7 Briefly explain the main objective of hashing techniques stating where it is beneficial than other methods. 8 What are the different functions used as hash function? 9 Draw a hash table with open addressing and a size of 9. Use the hash function "k%9". Insert the keys: 5, 29, 20, 0, 27 and 18 into your table (in that order).
10 What do you mean by good hash function? 1 Write an algorithm to sort a list of elements using radix sort technique. Using your algorithm sort the following set of elements: 231, 33, 87, 5, 6239, 93.Clearly show all the steps. 2 Write a non-recursive algorithm for quick sort. CO2 3 How insertion sort and selection sorts are different? VIII 4 What is merge sort and how it works? 5 Explain under what order of input, the insertion sort will have worst-case and best-case situations for sorting the set { 142, 543, 123,65,453, 879, 572,434} and explain steps in detail 6 What are internal sort and external sort? 7 Construct sorting for the following numbers using quick sort procedure.the numbers are : 42,12, -8, 98, 67, 83, 08, 104, 07 8 Explain binary search with an example. 9 What is interpolation search technique? 10 How insertion sort and selection sorts are different? CO2