MORE IN Programming and Data Structures 1
AU First Year Engineering (Semester 2)
Programming and Data Structures 1
May 2014
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary

1 With the help of the printf function show how C handles functions with variable number of arguments.
2 M

2 Define macro with an example.
2 M

3 Give applications in which unions rather than structure can be used.
2 M

struct student
{
int rollno =12;
float marks []={55, 60, 56};
char gender;
};
2 M

5 Should arrays or linked lists be used for the following types of applications. Justify your answer.
(a) Many search operations in sorted list.
(b) Many search operations in unsorted list.
2 M

2 M

7 Define double ended queue.
2 M

8 List the applications of a Queue.
2 M

9 What is the time complexity of binary search?
2 M

10 List sorting algorithm which uses logarithamic time complexity.
2 M

Answer any one question from Q11 (a) & Q11 (b)
11 (a) (i) Write a C program to find the unique elements in an array using a function ??nique?? The function takes the array as a parameter and prints the unique elements.
8 M
11 (a) (ii) Write a C program to print the fibonacci numbers.
8 M
11 (b) Write a C program to multiply two matrices that are represented as pointers. Use a function pointer to the function ' Multiply' which takes the two matrices as parameter and prints the result of the multiplication.
16 M

12 (a) (i) Write a C program to read the contents of a file ??n.txt??from last to first and write the contents to ??ut.txt??
8 M
Answer any one question from Q12 (a) & Q12 (b)
12 (a) (ii) Write the function prototype and explain how files are manipulated in C.
8 M
12 (b) (i) Create a structure to store a complex number and write function (for addition) that handle this new structure.
8 M
12 (b) (ii) Write a program to perform the following operation for the customers of a banl using the concept of structure.
(1) Input the customer details like name, account number and balance
(2) When a withdrawal transaction is made the balance must change to reflect it.
(3) When a deposite transaction is made the balance must change to reflect it.
8 M

Answer any one question from Q13 (a) & Q13 (b)
13 (a) Write an algorithm to perform insertion and deletion on a doubly linked list.
16 M
13 (b) Consider an array A[1:n]. Given a position, write an algorithm to insert an element in the array. If the position is empty, the elements is inserted easily. If the position is already occupied the element should be inserted with the minimum number of shifts. (Note: The elements can shift to the left or to the right to make the minimum number of moves).
16 M

Answer any one question from Q14 (a) & Q14 (b)
14 (a) Write an algorithm to convert an infix expression to a postfix expression. Trace the algorithm to convert the infix expression ??a+b)*c/d+e/f' to a postfix expression. Explain the need for infix and postfix expressions.
16 M
14 (b) Write an algorithm to perform the four operations in a double ended queue that is implemented as an array.
16 M

Answer any one question from Q15 (a) & Q15 (b)
15 (a) Write short notes on hashing and the various collision resolution techniques.
16 M
15 (b) Write an algorithm to sort 'n' numbers using quicksort. Show how the following numbers are sorted using quicksort: 45, 28, 90, 1, 46, 39, 33, 87.
16 M

More question papers from Programming and Data Structures 1