0% found this document useful (0 votes)
72 views3 pages

B.E./B.Tech: Degree Examination - May/ June 2014 Second Semester Computer Science and Engineering Cs 6202 - Programming and Data Structures - 1

This document contains questions that appear to be from a computer science degree examination for programming and data structures. It includes multiple choice and long answer questions about topics such as: 1) Functions in C with variable arguments, macros, unions vs structures, arrays vs pointers. 2) Applications of abstract data types, queues, sorting algorithms, binary search time complexity. 3) Programming problems involving unique elements in an array, Fibonacci numbers, matrix multiplication, file manipulation, complex numbers, bank account transactions, linked lists, arrays. 4) Algorithms for insertion/deletion in doubly linked lists, infix to postfix conversion, double ended queue operations, hashing techniques, quicksort.

Uploaded by

ssuukkuu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views3 pages

B.E./B.Tech: Degree Examination - May/ June 2014 Second Semester Computer Science and Engineering Cs 6202 - Programming and Data Structures - 1

This document contains questions that appear to be from a computer science degree examination for programming and data structures. It includes multiple choice and long answer questions about topics such as: 1) Functions in C with variable arguments, macros, unions vs structures, arrays vs pointers. 2) Applications of abstract data types, queues, sorting algorithms, binary search time complexity. 3) Programming problems involving unique elements in an array, Fibonacci numbers, matrix multiplication, file manipulation, complex numbers, bank account transactions, linked lists, arrays. 4) Algorithms for insertion/deletion in doubly linked lists, infix to postfix conversion, double ended queue operations, hashing techniques, quicksort.

Uploaded by

ssuukkuu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

STUDENTSFOCUS.

COM

B.E./B.Tech: DEGREE EXAMINATION . MAY/ JUNE 2014

Second Semester

Computer Science and Engineering

CS 6202 – PROGRAMMING AND DATA STRUCTURES – 1

(Common to Computer and Communication Engineering and Information Technology)

(Regulation 2013)

Time : Three hours Maximum : 100 marks

Answer ALL Question

PART A – (10 x 2 = 20 marks)

1. With the help of the print of function show how C handles functions with
variable number of arguments.
2. Define macro with an example.
3. Give applications in which unions rather than structures can be used.
4. Will be following declaration work. Justify your answer.
{
int rollno = 12;
float marks [] = {55,60,56};
char gender;

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
STUDENTSFOCUS.COM

6. What is advantage of an ADT?


7. Define double ended queue.
8. List the applications of a Queue.
9. What is the time complexity of binary search?
10. List sorting algorithm which uses logarithmic time complexity.

PART B – (5 x 16 = 80 marks)
11. (a ) (i) Write a C program to find the unique elements in an array using a
function “ Unique”. The function takes the array as a parameter
prints the unique elements.
(ii) Write a C program to print the Fibonacci numbers.
Or

(b) Write a C program to multiply two matrices that are represented as


pointers. Use a function pointer to the function „Multiply‟ which take the
two matrices as parameter and prints the result of the multiplication.

12. (a) (i) Write a C program to read the contents of a file “in.txt” from last
to first and write the contents to “ out. Txt”. (8)
(ii) Write the function prototype and explain how files are manipulated
in C. (8)
Or
(b) (i) Create a structure to store a complex number and write function
(for addition) that handle this new structure. (8)
(ii) Write a program to perform the following operations for the
customers of a bank using the concept of structures. (8)
(1) Input the customer details like name, account number and
balance.
STUDENTSFOCUS.COM

(2) When a withdrawal transaction is made the balance must


change to reflect it.
(3) When a deposit transaction is made the balance must change to
reflect it.
13. (a) Write an algorithm to perform insertion and deletion on a doubly linked
list.
Or
(b) Consider an array A [l:n]. Given a position, write an algorithm to insert an
element in the array. If the position is empty, the element 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)

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.
Or
(b) Write an algorithm to perform the four operations in a double ended queue
that is implemented as an array.

15. (a) Write short notes on hashing and the various collision resolution
techniques.
Or
(b) Write an algorithm to sort „n‟ number using quick sort. Show how the
following numbers are sorted using quick sort : 45,28,90,1, 46,39,33,87.

………………….

You might also like