0
987views
Data Structures and Applications Question Paper - Jun 17 - Computer Science (Semester 3) - Visvesvaraya Technological University (VTU)
1 Answer
0
9views

Data Structures and Applications - Jun 17

Computer Science (Semester 3)

Total marks: 80
Total time: 3 Hours

Note: Answer FIVE full questions, choosing one full question from each module.

1.a. Write a c program with an appreciate structure definition and variable declaration to read and display information about 5 employees using nested structures. Consider the following fields kike Ename, Empid,DOB (date, month,year) and salary (basic,DA,HRA).
(8 marks) 00

1.b. Give ADT of sparse matrix and show with a suitable example sparse matrix representation storing as triples. Give a sample transpose function to transpose sparse matrix.
(8 marks) 00

OR

2.a What is polynomial? What is degree of polynomial? Write a function to add two polynomials.
(8 marks) 00

2.b. List and explain the function supported by C for dynamic memory allocation.
(4 marks) 00

2.c. Write C program to concatenate Fname and Lname of a person without using any library function.
(4 marks) 00

Module-2

3.a. Define stack and write the ADT of stack implement push and pop function for stack using array with stack full and stack empty condition.
(4 marks) 00

3.b. What is an input restricted double ended queue? Implement the same with the supporting function.
(8 marks) 00

OR

4.a. Write a postfix form of the following expression using stack:

i) (a+b)d+e/(f+ad)+c ii) ((a/(b-c+d))(e-a)c)

(4 marks) 00

4.b. Write a function to evaluate a postfix expression and trace the same for the expression a b/c - d e * + a c * where a= 6. b=3 , c=1 , d=2 , e=4.
(6 marks) 00

4.c. Explain with a suitable example how would you implement circular queue using dynamically allocated array.
(6 marks) 00

Module-3

5.a. Give the node structure to create a linked list of Integers and write c c functions to perform the following:

i) create a three node list with data 10,20,30.

ii) insert a node with the data values 15 between the nodes having the data values 19and 20.

iii) Delete the node whose data is 20.

iv) Display the resulting singly linked list.

(10 marks) 00

5.b. Write a node structure for linked representation of polynomial. Explain a algorithm to add two polynomials represented using likned list.
(6 marks) 00

OR

6.a. Write c function to perform the following:

i) Reversing a simply linked list.

ii) Concatenating single linked list.

iii) Finding the length of the list.

(6 marks) 00

6.b. List out the difference between the doubly linked list and singly linked list. Illustrate with example the following operation on a doubly linked list:

i) Inserting the node at the beginning.

ii) Inserting at the intermediate beginning.

ii) Deletion of a node with a given value.

iv) Search a key element.

(10 marks) 00

Module-4

7.a. Define binary trees. Explain the following with example.

i) complete binary tree

ii) skewed binary tree.

iii) Almost complete binary tree.

iv) Degree of a binary tree.

(9 marks) 00

7.b. For the given data , draw a binary search tree and show the array and linked representation of the same 100,85,45,55,110,20,70,65.
(7 marks) 00

OR

8.a. Draw a binary tree for the following expression 3 + 4 * ( 7 - 6 ) / 4 + 3. Transverse the obove generated tree using inorder , pre-order and postorder. Also write a function in C for each one.
(9 marks) 00

8.b What is advantage of threaded binary tree o er binary tree ? Explain the construction of threaded binary tree for 10,20,30,40,50.
(7 marks) 00

Module-5

9.a. Define graph. Write the differences between graph and trees. For the given graph , show the adjacency matrix and adjacency list representation of the graph.[Refer figure.Q9(a)]

enter image description here

(8 marks) 00

9.b. What are the methods used for traversing a graph ? Explain any one with example.
(8 marks) 00

OR

10 a. Write a c function for insertion sort. Sort the following list using insertion sort :50,30,10,70,40,20,60.
(8 marks) 00

10.b. What is collision? What are the methods to resolve collision? Explain linear probing with an example.
(8 marks) 00

Please log in to add an answer.