ANAND INSTITUTE OF HIGHER TECHNOLOGY
AN AUTONOMOUS INSTITUTION
Department of Computer Science and Business Systems
A
MODEL EXAMINATION
Course Title:C PROGRAMMING AND DATASTRUCTURES Course Code:CS3353
Duration: 3 hr Date: Maximum Marks: 100 marks
Class (Year/Sem/Dept): II/III/ECE
Instructions:
1. Before attempting any question paper, be sure that you got the correct question paper.
2. The missing data, if any, may be assumed suitably
3. Use the sketches wherever necessary
Q.N
Questions Marks BTL CO
o
Part A - (10×2 = 20 Marks) Answer all Questions
1 Difference between postfix and prefix operator. 2 BTL 1 CO1
2 What is variables? 2 BTL 1 CO1
3 Define enumerated data types? 2 BTL 1 CO2
4 State the purpose of conditional compilation. 2 BTL 1 CO2
Specify the rules to be followed with respect to priority queues BTL 1
5 2 CO3
during insertion and deletion process.
6 List the few applications of doubly linked list. 2 BTL 1 CO3
7 Difference between post order traversal and in order traversal. 2 BTL 1 CO4
8 Define separate chaining. 2 BTL 1 CO4
9 What is the worst run time of insertion sort specify the scenario? 2 BTL 1 CO5
10 List the disadvantages of linear search. 2 BTL 1 CO5
Part B - (5×13 = 65 Marks)
Explain the different types of operators used in C with necessary BTL 2
11 a 13 CO1
program
or
11 b Explain the different looping statement with example? 13 BTL 2 CO1
(i)what is the significance of structure in language c? explain in BTL 2
12 a detail with an example program. 13 CO2
(ii)Write brief notes on preprocessor directives.
Enumerate difference between structures ,pointer, function and BTL 2
12 b 13 CO2
unions.
Analyze and write algorithm for Circular Linked list for the BTL 2
13 a following operations using structure pointer. 1) Insert 2) Delete 3) 13 CO3
Display
Write a C code for singly linked list with insert, delete, and display BTL 2
13 b 13 CO3
operations using structure pointers.
Discuss in details about Kruskal’s and prims algorithm for weighted BTL 2
14 a 13 CO4
undirected graph
(i) What is traversal? explain various methods of traversals. BTL 2
What is hash function? explain of concept of hashing table with
14 b 13 CO4
examples
15 a Difference between linear search and binary search. 13 BTL 2 CO5
AIHT/IQAC/QP/MODEL/001
ANAND INSTITUTE OF HIGHER TECHNOLOGY
AN AUTONOMOUS INSTITUTION
Department of Computer Science and Business Systems
(i) List the steps by step for sorting the following numbers BTL 2
using merge sort (38,27,43,3,9,82,10)
(ii) (ii)perform heap sort on the following arrarys of elements
15 b (9,7,5,11,12,2,14,3,10,6) and produce the step by step 13 CO5
procedure.
(iii) Implementation of binary search tree on the following set
of items(12,18,23,25,29,32,35,40,58,68) and key=18.
Part C (1×15 = 15 Marks)
(i) Construct BST for the following (20,30,10,40,50, -20, BTL 2
-30,60)
16 a Write the algorithm to construction an expression tree and construction an 15 CO4
expression tree for the input ab+cde+**
(i) Given two sorted Linked lists L1 and L2. Exemplify and write the functions to BTL 2
compute L1 ∩ L2 and L1 U L2.
16 b (ii) State the advantages of Linked list over arrays. Specify any two real time 15 CO3
applications
of Linked list.
Subject Staff HO
AIHT/IQAC/QP/MODEL/001
ANAND INSTITUTE OF HIGHER TECHNOLOGY
AN AUTONOMOUS INSTITUTION
Department of Computer Science and Business Systems
B
MODEL EXAMINATION
Course Title:C PROGRAMMING AND DATA STRUCTURES Course Code:CS33553
Duration: 3hours Date: Maximum Marks: 100 marks
Class (Year/Sem/Dept): II/III/ECE
Instructions:
1. Before attempting any question paper, be sure that you got the correct question paper.
2. The missing data, if any, may be assumed suitably
3. Use the sketches wherever necessary
Q.N
Questions Marks BTL CO
o
Part A - (10×2 = 20 Marks) Answer all Questions
1 What is the difference between getc () and getchar ()? Explain. 2 BTL 1 CO1
2 Define an array .Give an example. 2 BTL 1 CO1
3 List any four advantages of pointers. 2 BTL 1 CO2
4 Difference between call by value and call by Reference. 2 BTL 1 CO2
Write a procedure to insert an element in the beginning of a list BTL 1
5 2 CO3
ADT implemented using a singly linked list
The in order traversal of a binary tree resulted in E A C K F H D B BTL 1
6 2 CO3
G what would its preorder traversal return?
7 What is graph ? list the two ways to represent a graph. 2 BTL 1 CO4
8 State the drawbacks of insertion sort. 2 BTL 1 CO4
Give the algorithm to search an element in an array using linear BTL 1
9 2 CO5
search
10 What are the two ways of representation binary tree ? 2 BTL 1 CO5
Part B - (5×13 = 65 Marks)
(i)Write about the compilation and linking processes involved in a BTL 2
C
11 a 13 CO1
(ii)Write a program in C to find the sum, difference , product ,and
transpose of two matrices
Or
(i)Explain string handling in C programming language with BTL 2
example.
11 b 13 CO1
(ii)Write a program in C to convert all upper case letters to lower
case and vice versa in a given string.
(i)Explain function declaration ,function call and function BTL 2
12 a definition in detail 13 CO2
(ii)write a C program to find factorial using recursion.
(i)Explain structure and union in C language in detail with BTL 2
example.
12 b 13 CO2
(ii)Mention the advantages and disadvantages of structures and
unions.
13 a (i)Represent two polynomials using singly linked lists and develop 13 BTL 2 CO3
procedures to add them.
AIHT/IQAC/QP/MODEL/001
ANAND INSTITUTE OF HIGHER TECHNOLOGY
AN AUTONOMOUS INSTITUTION
Department of Computer Science and Business Systems
(ii) Develop algorithms to perform insertion , deletion, and search
operations in a queue implemented using singly linked lists.
Develop procedures to perform push and pop operations on an BTL 2
13 b array implementation of stack and use the same to evaluate a 13 CO3
postfix expression 123 * - 4 + .
(i) How can binary trees be represented using arrays ? BTL 2
write routines to perform insertion and deletion in a
14 a tree. 13 CO4
(ii) Write routines to convert a set as a tree and perform find
operation on the elements. illustrate with examples.
With necessary algorithms explain the two graph traversal methods BTL 2
14 b 13 CO4
demonstrate with examples.
.Write a recursive algorithm for quick sort and apply the same to BTL 2
15 a 13 CO5
sort the elements 12,3,2,26,5,21,18,25,and 50 and trace the output.
(i)Sort the elements 12,3,2,26,5,21,18,25,50 using merge sort and BTL 2
trace the output..
15 b 13 CO5
(ii)Develop an algorithm to perform binary search on an array of
elements and demonstrate with an examples.
Part C (1×15 = 15 Marks)
Design an algorithm to convert an infix expression to postfix BTL 2
16 a expression using stacks and apply to the expression (a + b – d * e + 15 CO4
(f*g+h)*I)
Or
.Write a C program to implement linear search and binary BTL 4
16 b 15 CO5
search.
Subject Staff HOD
AIHT/IQAC/QP/MODEL/001