0% found this document useful (0 votes)
44 views2 pages

Data Structures, III Sem, June 2019

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)
44 views2 pages

Data Structures, III Sem, June 2019

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/ 2

Hall Ticket Number:

Code No. : 13212 S


VASAVI COLLEGE OF ENGINEERING (Autonomous), IIYDERABAD
B.E. (CSE: CBCS) Ill-Semester Supplementary Examinations, June-2019
Data Structures
Time: 3 hours Max. Marks: 60

Note: Answer ALL questions in Part-A and any FIW from Part-B
Part-A(10x2=20Marks)
I What is the matrix which has more number of zero entries? How it can be
represented effi ciently.
2. Determine the time complexity of the following C function.
void add( int a[ ][MAX_SIZE], int b[ ][MAX_SIZE], int c [ ][MAX_SIZE],
int rows, int colsl
{
int i, j;
for(i-0;i<rows;i++)
for(=oioo" '**,
ctilUl=atiltjl - bliltjl:
)

) Desiga a function to double the size ofa stack evory time when it becomes
tull .
4 Given the elements stored in doubly linked list as shown below.
h7*

lo
'--'l* t'
,*
3000 zxx) r
L00(} l5 z0 ,.ooo

1000 2&O 3(}0()

Show how these elements are stored in a singly linked list data structure with
the help ofa diagram. AIso represent the address information in the nodes
5 Write a function to find the number of [eaf nodes in a binary tree.

6 Find the minimum cost spanning tree for the given graph using Kruskal's
algorithm
5
a

7 Which sorting technique is more suitable for the given data set.
t2 t4 56 4s 78 89 90
8 What is hashing ? List the hashing techniques.

9 What is the significance of a B- tree ?

10. Design an algorithm to find the balance lactor ofeach node in an AVL tree

Contd. ..2
2 Code No:13212 S

Part-B(5X8=40)
(AIl Sub-Questions carry equal marks)

ll. a) Design a function to insert the element'n' in the ks position ofthe linked list.

b) Write a function to search for an element'k' in an array ofsize 'n'.


12. a) What is queue ? How it is implemented using linked list?
b) Design an algorithm for infix to postfix expression conversion , showing the stack
content and output expression after each operator read from the given input expression.
(20+30* I 0)-(erf+g)/h+i

13. a) Design a function to insert an element into the binary search tree.

b) Write the algorithm to perform DFS on a given graph. Write the 4 DFS for the follorving
graph from node D,

14. a) Design an algorithm to sort the elements using merge sort technique

b) Given the hash function h=key mod 10, where l0 is the sizc ofthe hash table. Insert the
following data into hash table. Use linear probing to address the collisions.
25, 146, 304, I t0, 550, 696, 88, 28, 97, 7 6

15. a) What is splay tree ? Explain inserting an element into a splay tree with example.

b) Construct an AVL tree by specifying the type ofthe rotations performed while inserting
elements
1025 45 1220 ts25

16. a) Explain the space and time complexities of an algorithm with example.

b) Given the attributes of employee, emp_id, emp_name, emp-designation, and


emp_salary. Write a program to accept 'n' employee details as input and store their
details in a linked list. Also display the details of the employees who are eaming more
than Rs.20000.

17 . Answer any ,rra of the following:


a) Write a function for inorder and preorder raversal of a Binary tree

b) Show the heap structure and sequence of elements during each iteration of heap sort
algorithm when applied to following sct of elements.
45 125 150 80 40 95 15 450 100
c) Explain inserting an element into a B-tree rvith example.

You might also like