Seat No.: ________ Enrolment No.
___________
GUJARAT TECHNOLOGICAL UNIVERSITY
[Link]- SEMESTER–II EXAMINATION – SUMMER 2022
Subject Code:21120201 Date:26-07-2022
Subject Name:Data Structures
Time:10:30 AM TO 12:30 PM Total Marks:50
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Simple and non-programmable scientific calculators are allowed.
Marks
Q.1 (a) Give the difference between structure and union. 05
(b) What is Data Structure? Explain the types of data structures in detail. 05
Q.2 (a) Write an algorithm to perform enqueue and dequeue operations in a queue. 05
(b) Convert following infix expression into postfix (reverse polish) format. A ^ 05
B * C - D + E / F / (G + H)
OR
(b) Write an algorithm for evaluation of postfix expression and evaluation the 05
following expression showing every status of stack in tabular form. 7 5 2
+*411+/-
Q.3 (a) Define Queue. What are the benefits of circular queue over Queue? 05
(b) Write an algorithm for stack operations Push, Pop and Empty. Assume 05
stack is implemented using array.
OR
Q.3 (a) Explain Time and space complexity of an algorithm. 05
(b) What is linked list? Explain Singly and doubly linked list. 05
Q.4 (a) What is AVL tree? State and explain the different rotations in AVL tree 05
with examples.
(b) Construct binary search tree for the following data: 05
10,3,15,22,6,45,65,23,78,34,5
Find inorder, preorder and postorder travesal.
OR
Q.4 (a) Define 2-3 tree. Describe the characteristic of 2-3 tree. 05
(b) Define height of the binary tree. Define height balanced tree with its 05
advantages. Construct a height balanced binary tree (AVL tree) for the
following data: 42,06,54,62,88,50,22,32,12,33
Q.5 (a) What is graph? Explain various representations of graph. 05
(b) Explain the trace of bubble sort on following data. 05
42,23,74,11,65,58,94,36,99,87
OR
Q.5 (a) What is searching? Explain binary search with example. 05
(b) Write the algorithm for quick sort and sort the following numbers 05
according to it.
25, 85, 60, 10, 58, 47, 35,16, 72,50
***********