Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

1221 Question Paper

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Seat No: ______________ Enrollment No: ____________________

PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
B.Tech. Summer 2018 - 19 Examination
Semester: 3 Date: 25/05/2019
Subject Code: 03105203 Time: 02:00pm to 04:30pm
Subject Name: Data Structures Total Marks: 60

Instructions:
1. All questions are compulsory.
2. Figures to the right indicate full marks.
3. Make suitable assumptions wherever necessary.
4. Start new question on new page.

Q.1 Objective Type Questions - (All are compulsory) (Each of one mark) (15)

1. How do you initialize an array in C?

(a) int arr[3] = (1,2,3); (b) int arr(3) = {1,2,3};


(c) int arr[3] = {1,2,3}; (d) int arr(3) = (1,2,3);

2. Queue Data structure follows

(a) LIFO (b) FILO (c) LILO (d) None of these

3. Assuming int is of 4bytes, what is the size of int arr[15];?

(a) 15 (b) 19 (c) 11 (d) 60

4. Insert an element in array at index k will take how much time?

(a) O(1) (b) O(n-k) (c) O(log(n-k)) (d) O(n2-k)

5. The statement head->Link->Link->Link -> link = = NULL terminates a linked list after its _ node.

(a) 2nd (b) 4th (c) 5th (d) 3rd (e) first.

6. Binary Search Complexity is O (log2 n) in worst case. True/False

7. Address Calculation in array is possible only by row major order. True/False

8. Binary tree has exactly two children. True/False

9. Every graph is a tree. True/False

10. Inserting a Node at the end of link list takes O (1) time. True/False

11. Pointer is used for __________________ memory access.

12. Write overflow condition for stack______________________

13. Write Underflow condition for circular queue_________________

14. Write any two application of stack.

15. Total no of nodes in the binary tree of having height h.

Q.2 Answer the following questions. (Attempt any three) (15)


A) Explain Multidimensional Array. Find the address of A [3][2] in row major and column major
order. Given, base address is 2000 for an array A [10] [6] and assuming int is of 4bytes.

B) Sort the following elements using Bubble sort.


40,15,65,56,78,31,42,15

Page 1 of 2
C) What are the methods for collision avoidance in hashing and explain one in detail.

D) Explain Insert operation in circular queue with diagram.

Q.3 A) Write an algorithm for push and pop operation into stack. (07)

B) Write an algorithm to perform each of the following operations on singly linked list using (08)
head/first or start node.
1. add node at the end
2. insert a node containing x data after node having address p

OR
B) What is Heap and explain it as per its types? Also construct MIN heap for the following Sequence. (08)
21, 18, 11, 4, 50, 56, 33, 11

Q.4 A) Explain Tower of Hanoi problem and Explain it by N=3 where N means no of plates. (07)
OR
A) Transform the following expression to postfix and evaluate postfix expression (by assuming P=1, (07)
Q=2, R=3, S=5, T=5, U=6, V=4 and W=3) P +Q-R*S/T +U*V/W

B) Write an algorithm to perform each of the following operations on Circular linked list using (08)
head/first or start node.
1. add node at the start
2. add node at the end

Page 2 of 2

You might also like