You are on page 1of 2

USN 1 S I OE02

Siddaganga Institute of Technology, Tumakuru – 572 103


(An Autonomous Institution affiliated to VTU, Belagavi, Approved by AICTE, New Delhi)

Even Semester Bachelor of Engineering Examinations April - May 2019


Data Structures with C
Time: 3 Hours Max. Marks: 100
Note : 1. Question No. 1 is Compulsory.
2. Answer any 4 full questions from question No. 2 to Question No. 6.

1 a) Differentiate between dynamic and static memory allocation.


b) Construct BST for the following data 100, 10, 20, 15, 111, -5, 80.
c) Write C module to count the number of nodes in singly linked list.
d) Show the different status of circular queue of size 3 for the following operations. (i) Delete
(ii) Insert 10,20,30,40 (iii) Delete (iv) Insert 50.
e) Convert the following infix expression to postfix and prefix using manual method
(A$B /D* M) / (X$Y +Z).
f) Write C function to find product of array elements using pointers.
g) Show the status of stack of size 2 for the following operation.
(i) push 10, 20, 30 (ii) pop (iii) pop (iv) insert 55.
h) Construct binary expression tree for given expression (A* B/C+D)-(Z+Y$P)-M.
i) Write recursive function for binary search.
j) Given the employee structure definition and base address as 1000, compute the address of the
following (i)E[5].age (ii)E[3].dept
Struct employee { char Ename[20], int age, float salary, char dept[10];} 2  10

2 a) Write a program using pointers to determine the length of a character string. 6


b) How can a structure be declared using typedef? Briefly explain the concept of embedded
structures with an example. 6
c) Differentiate between dynamic memory allocation and static memory allocation. Explain C
built in dynamic memory allocation functions. 8

3 a) What a C program to perform PUSH and POP operations for STACKS using arrays. 6
b) Evaluate the following postfix notation using stack 8, 5, 2, *, +, 4, 2, /, - and also write the
algorithm for evaluation of a postfix expression. 6
c) What is the limitation of ordinary queue? Develop insertion and display modules for circular
queues using arrays. 8

4 a) Write C functions to perform the following operations on singly linked list. (i) To insert a
new node after a node. (ii) To delete the last node. 10
b) Write a C program to implement a queue using singly linked list. 10

5 a) Develop a C program to implement ascending priority queues using singly linked list. 10
b) What are the benefits of lists with a header node? 2
c) Write a C function to search for a key element in a doubly linked list. 4
d) Develop C module to create circular singly linked list. 4

6 a) Write the memory representation for the given Fig. 6a


weighted graph.

Fig. 6a 4
-1- Please Turn Over
-2- OE02
b) Write recursive function for counting the number of leaf nodes in binary tree. 3
c) What is the meaning of traversing a tree? Write C functions to traverse the tree using
preorder, post order and inorder traversal. 7
d) Explain the following with appropriate examples.
(i) Threaded Binary tree (ii) Strictly Binary tree. 6
________

You might also like