Tech Unleashed

Wohoo!! We're on YouTube

Thursday, 17 November 2022

Data Structure : Mid Semester Examination ( 3rd Sem )

 Data Structure

Mid Semester Examination, 2021-22
B. Tech - Semester : 3
Time : 1.30 hrs. - Max. Marks : 40

Instructions:
  1. All questions are Compulsory
  2. Assume missing data suitably, if any.
Section : A ( 2 x 2 = 4 Marks )
All questions are compulsory
  1. Define abstract data type.
  2. Define memory leak and dangling reference.
Section : B ( 4 x 2 = 8 Marks )
All questions are compulsory
  1. Define complexity and discuss asymptotic notations with suitable diagram.
  2. Write an algorithm / pseudo code to reverse a single linked list.
Section : C ( 6 x 2 = 12 Marks )
All questions are compulsory
  1. Define sparse matrix and give sparse matrix representation.
    OR
    Write an algorithm / pseudo code for matrix multiplication.
  2. Write an algorithm / pseudo code for insert a node at first position in doubly linked list.
    OR
    Write an algorithm / pseudo code for insert a node at last position in circular linked list.
Section : D ( 8 x 2 = 16 Marks )
All questions are compulsory
  1. Write the recursion function in C programming for Tower of Hanoi. Sketch recursion tree for Tower of Hanoi with number of disk as 3.
    OR
    Assume the declaration of multidimensional arrays A and B to be, A(-2:2, 2:22) and B(1:8, -5:5, -10:5) : (a). Find the length of each dimension and the number of element of A and B. (b) Find the address of the element B[2][2][3], assume Base B = 400 and there are W = 4 words per memory.
  2. Discuss Dynamic Memory Allocation and explain the syntax of following Malloc, calloc, realloc, free functions.
    OR
    Write the function of polynomial addition with the help of linear linked list.
    struct Node {
       int coeff;
       int pow;
       struct Node *next;
    };

    Input:
       1st number = 5x^2 + 4x^1 + 2x^0
       2nd number = -5x^1 - 5x^0
    Output:
       5x^2 - 1x^1 - 3x^0

*******************

No comments:

Post a Comment