Data Structure
Mid Semester Examination, 2021-22
B. Tech - Semester : 3
Time : 1.30 hrs. - Max. Marks : 40
Instructions:
- All questions are Compulsory
- Assume missing data suitably, if any.
Section : A ( 2 x 2 = 4 Marks )
All questions are compulsory
- Define abstract data type.
- Define memory leak and dangling reference.
Section : B ( 4 x 2 = 8 Marks )
All questions are compulsory
- Define complexity and discuss asymptotic notations with suitable diagram.
- Write an algorithm / pseudo code to reverse a single linked list.
Section : C ( 6 x 2 = 12 Marks )
All questions are compulsory
- Define sparse matrix and give sparse matrix representation.ORWrite an algorithm / pseudo code for matrix multiplication.
- Write an algorithm / pseudo code for insert a node at first position in doubly linked list.ORWrite 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
- Write the recursion function in C programming for Tower of Hanoi. Sketch recursion tree for Tower of Hanoi with number of disk as 3.ORAssume 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.
- Discuss Dynamic Memory Allocation and explain the syntax of following Malloc, calloc, realloc, free functions.ORWrite 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