IOTModel QP
IOTModel QP
OR
b. i)Why we use functions in C language. Give example. (5)
RAJIV GANDHI COLLEGE OF ENGINEERING
12.a i) Define macro. Write a macro to find the area of rectangle and use it in a C program.
ii)Explain the various text file opening modes and their meaning in C
iii)State and explain the pre processor directives.
OR
b. Explain the structure,nested structure and self-referential structure with example (13)
13.a i)Write and explain the algorithms of peek and display operations of stack (8)
ii)List the advantages and disadvantages of representing a group of items as an array versus a
linked list (5)
OR
b. Explain the procedure for converting an infix expression to a postfix expression using a stack.
Convert the following infix expression into a postfix expression x*(w+y/2*x^(4+x)) and
evaluate the obtained postfix expression using the values (x=1,y=2,w=3). (13)
14.a State and explain the Insertion and deletion operation in a binary search tree with example.
OR
b. i)What is a hash function? Explain the concept of hashing with an example. (8)
ii)Define Double hashing and list the advantages of the same. (5)
15.a Distinguish between min heap and Max heap. Show how heap sort processes the input 142,
543, 123, 65, 453, 879, 572, 434 , 111 ,242 , 311 and 102.
OR
i)Write and explain the algorithm of linear search. (6)
ii)Explain the basic idea behind the insertion sort and how it works. (7)
PART C (1x15=15 marks)
16.a What is open addressing? Explain the collision resolution strategies in open addressing with
examples (13)
OR
16.b Sort the sequence. 4 ,6 ,8, 2, 9 , 5, 1 , 7 and 3 using the following
i).Merge sort. (7)
ii).Quick sort ( Picking the first element as the pivot.) (8)
RAJIV GANDHI COLLEGE OF ENGINEERING
PART A ( 8x2=16)
1. List the advantages of linked list over arrays.
2. Write the underflow and overflow conditions in stack.
3. Outline a circular linked list with a diagram.
4. Name any four applications of queue in the field of computer applications.
5. What is a hash function?
6. When is rehashing necessary?
7. Define Separate Chaining.
8. Construct a binary tree for the expression A+(B-C) *D*(E+F).
PART B (1x8=8)
9. Write short notes on doubly linked list with few operations.
PART C (2x13=26)
10.a i) Devise an algorithm to perform push and pop operation in a stack. (8)
ii)Define ADT and list the advantages of the same. (5)
OR
10.b i) Convert the following arithmetic expression in infix form to postfix form using stack:
A+B/C+D*(E-F)^G (8)
ii)Write and explain the algorithm of enqueue operation of queue . (5)
OR
11.b ) .b) What is open addressing? Explain the collision resolution strategies in open addressing with
examples (13)
RAJIV GANDHI COLLEGE OF ENGINEERING