Вы находитесь на странице: 1из 6

Data Structures 1.

Explain steps for Huffmans Code Symbol A B C D E Frequency 14 11 10 8 6 Symbol Frequency Symbol Frequency Symbol Frequency A 7 A 10 A 7 B 6 C 3 B 14 C 4 D 4 C 5 D 6 G 2 D 19 E 5 I 4 E 29

F 17 F 1 K 2 F 11

G 12 G 10 M 3 G 22

H 13 H 7 N 6 H 15

I 9 I 8 O 8

2. Diff bet Directed and undirected graph Sequential and Binary Search Tree and Graph Singly Linked List and Doubly Linked List Complete binary Tree and almost complete binary Tree Tree 3. What is a general tree? Explain with example conversion of general to binary with eg.

4. Define m-way and B-trees. Build a B-tree of order 5 by inserting the data in the sequence given below. 88 20 2 3 7 5 18 1 21 12 15 16 74. Build a B-tree of order 3 for the data in the sequence given below. 21, 57, 78, 42, 45, 65, 71, 59 Build a B-Tree of order 3 created by inserting the following data arriving in sequence 77, 12, 48, 69, 33, 89, 97, 91, 37, 45, 83. Construct B tree of order 3 for the following data values arriving 12in the sequence 92 24 6 7 11 8 22 4 5 16 19 20 78 Draw the B-tree by inserting the 10 elements in following order 3 9 8 4 13 6 10 15 12 7 21 11 20 26 5 15 16 22 23 18 Delete the elements 1 0, 20 and 18.

5. What is the need of balancing a binary tree? What are the advantages of AVL trees? Write a pseudo code for Rotate AVL tree right and left and explain with eg. AVL tree 3 5 11 8 4 1 12 7 2 6 10 10. What is a binary tree? The following binary tree has the FECHGDBA post order FCEABHDG in order Write pseudo code for the same lnOrder Traversal : A B C D E F J G I H Preorder Traversal: J C B A D E F I G H Show a step wise reconstruction of the binary tree along with its post order traversal Postorder : F E C H G D 8 A Inorder :FCEABHDG Show a step wise reconstruction of the binary tree along with its pre order traversal Draw the tree given the preorder and the in order traversal as follows :Pre order L J G C D A B K H E I F In Order C G A D B J L E H K I F Also give the post order traversal of the tree. 6.What is a height balanced tree?why do we require a height balanced tree 7.What is analysis of algorithm? Explain Big-O,, notation

ALgos 1) for search and sort an element in singly link list 2) to count no of elements in the list 3) Append two lists together. 4) Interchange the nth and mth element of a doubly linked list. 5) Write a pseudo code to delete an element from doubly link list 6) Creating an element, inserting an element and deleting an element from the circular queue. 7) Write an algorithm to sort elements using bubble sort. 8) Search the element in doubly linked list 9) Print the list elements in reverse order. 10) Find an element in circular linked list 11) Delete an element in circular linked list 12) Write algorithm for Left balancing a tree. 13) To find the smallest element in the binary tree 14) To delete an element form the binary tree. 15) Write an algorithm to traverse a tree in Pre-order, In-order and Post-order. 8.Definehash search. Using the rotation method for hashing and linear probe method and Modulo -Division for resolving collision store the keys shown below in an array of 19 elements. First rotate the right most 2 digits to he left and then use the digit extraction 1st 3rd 5th digits 254761 167953 244664 160849 254872 182741 174767 129449 234534

How many collisions occurred? What is the density of the list after all keys have been inserted? Define collision. Explain collision resolution methods with example. Using the rotation method for hashing and linear probe method and Modulo -Division for resolving collision store the keys shown below in an array of 19 elements. How many collisions occurred? What is the density of the list after all keys have been inserted? 224562, 137456, 214562, 140145, 214576, 162145, 144467. 199645, 234534. Define clustering in hash list. Using mid-square method and key offset, store the keys shown below in array size 13, 55, 65, 20, 12, 66, 26, 90. What is hashing? Define the terms collision, probe and the load factor insert the keys 99 33 23 44 56 43 19. Using the division method and quadratic probing as the collision resolution method into a list of size 10.Also find the number of collisions, probes for each element and the density of the list. 9.Explain the queue data structure with eg. Write algoEnqueue,DEqueue, QueueFront and QueueRear functions Explain the working of a circular queue Define and explain the stack data structure with a suitable example. Give algorithms for Push, Pop, StackFull and StackEmpty functions. 10.Defineheap. Give algo for Reheap up. Show the array implementation of the heap in the following fig Apply delete operation to the heap on the following fig and repair heap. Insert 39 and repair it after insertion.

Make a heap 23, 7, 92, 6, 12, 14, 40, 44, 20, 21 Max Heap 42, 23, 74, 11, 65, 3, 94, 36, 99, 87 Max Heap 12 3 10 14 58 26 18 2 91 3 Build a max heap by inserting the following values in the heap 16 31 5 22 45 74 2 42 Show the heap after deleting 2 elements consider the array before deleting and sort the array using heap sort 11.Warshallsalgo with eg.

12.Walgo for shell sort use incremental factor k=5,3,1 87 72 24 19 40 31 90 35 80 65 81 94 11 96 12 35 17 95 28 58 41 75 15 Notes 1) 2) 3) 4) Circular Linked Lists Priority queues Huffman Code as an application of tree Graph storage structures.

13.Define binary tree traversal .Depth-first Traversal and Breadth-First Traversal in graphs. 14.Using mid square hashing method store the keys given below in an array of size 1000 224562, 137456, 214562, 140145, 214576, 162145, 144467, 199645,234534 Because of the key length square only the first three digits of the key.Use pseudorandom number generator for rehashing is collisions occur (Take a = 3andc=1 as factors)

15.GiveDjikstra's algorithm to determine the shortest path in a graph 16.Determine the minimum spanning tree of the following graph using Kruskal's algorithm.

Give minimum spanning tree using Kruskal's and Prim's algorithm for graph shown below

17.Give DFS and BFS traversal of the graph shown below.

Sort following array elements using bubble sort: 7 8 26 44 13 23 98 57

Explain with example how adjacency list stores graph information into. An array contains the e1ements shown below. Using binary search algorithm, trace the steps to search element 44.At each loop iteration, show the contents of first, last & mid 8, 13, 17, 26,44, 56, 88, 97 What is sorting Sort the following elements using Quick Sort method 14 6 4 8 11 12 10 13 write algo and efficiency What is searching Find the element 85 using the binary search and the interpolation search in the following array show the values of the various parameters at each step.15 25 35 45 55 65 75 85 95 105Give the time complexity of both the methods.

Define Expression tree. The following infix expression is given. Draw the expression tree and find prefix and postfix expression. (C + D +A B) (E + F) Write a program in C to sort array of n elements using insertion sort. What is the efficiency in terms of Big 0 notation and discuss best case average case and worst case of insertion sort Define LL DLL Stack Queue

Вам также может понравиться