Paper Code: BCST 303                                                                  Roll No…………
ODD SEMESTER EXAMINATION, 2022 – 23
                                      B. Tech II Year
                   Computer Science & Engineering 3rd Semester
                                    DATA STRUCTURES
Time : 3 Hours                                                                Total Marks : 100
1.    Attempt any four parts of the following:                                           (5 × 4 = 20)
      (a)    Define data, information, algorithm and data structure? Give the difference
             between linear and non-linear data structures with example.
      (b)    Define abstract data types. Explain it briefly?
      (c)    Derive and explain in brief a formula to obtain an address of any element in 3-
             dimensional array stored in row-major order.
      (d)    What is complexity? What do you understand by worst case time complexity of
             an algorithm? Explain.
      (e)    Write a C program which sorts a list of n items insertion sort method. Illustrate using an
             example.
      (f)    Write short notes on Sparse Matrices.
2.    Attempt any four parts of the following:                                          (5 × 4 = 20)
      (a)    Define a Queue data structure. Write an algorithm to delete and insert an item
             from/in to the queue.
      (b)    Convert the expression 12/(7-3)+2*(3+8)-7 to equivalent Postfix notations and then
             evaluate it.
      (c)    State the Tower of Hanoi Problem. Write recursive algorithm to solve the problem.
      (d)    Explain Recursion with the help of suitable examples. Let n denote a positive
             integer. Suppose a function L is defined recursively as follows:
             L(n) = { 0    if n=1
                    { L(|_ n/2_| +1) if n>1
             a. Find L(25)
             b. What does this function do?
      (e)    Define Stack? Write functions to pop and push elements from/into the stack.
      (f)    Explain the concept of priority queue with suitable example.
3.   Attempt any two parts of the following:                                           (10 × 2 = 20)
     (a)    Define Linked Lists and its various types. Write a function to reverse the elements
            of a linked list.
     (b)     What is an AVL tree? Insert the given values in an AVL tree.
            1,2,3,4,5,6,7,8,9,10,11,12
     (c)    Draw the binary search tree that results from inserting into an initially empty tree
            records with keys given in order?
                   E, A, S, Y, Q, U, E, S, T, I, O, N and then deleting Q.
4.   Attempt any two parts of the following:                                           (10 × 2 = 20)
     (a)    Give step wise procedure for in-order and post-order traversal of Binary Tree using
            examples.
     (b)   Write a C program which sorts a list of n items insertion sort method. Illustrate using an
           example.
     (c)   Explain Heap sort? Sort the given values using Heap Sort?
                65      70      75       80      85      60       55      50      45
5.   Attempt any two parts of the following:                                           (10 × 2 = 20)
     (a)    What is a B-Tree? Draw the B-tree of order 3 created by inserting the following data
            arriving in sequence –
                     92 24 6 7 11 8 22 4 5 16 19 20 78
     (b)   Define Graph? Write a procedure which finds the shortest path from a given node
            A to a given node B.
     (c)    What is hashing? Explain various methods to find hash functions? How collision
            situation can be avoided?