Question-Regular-Cs205 Data Structures (CS, It), December 2017
Question-Regular-Cs205 Data Structures (CS, It), December 2017
Total Pages: 2
Reg No.:_______________ Name:__________________________
PART B
Answer any two full questions, each carries 9 marks.
5 Describe Big O notation used to represent asymptotic running time of algorithms. (9)
Give the asymptotic analysis of any one iterative algorithm.
6 a) Consider a singly linked list having n nodes. The data items d1, d2, …., dn are (5)
stored in the n nodes. Let X be a pointer to the jth node (1 ≤ j ≤ n) in which dj is
stored. A new data item d stored in a node with address Y is to be inserted in the
list. Give an algorithm to insert d into the list after dj to obtain a list having items
d1, d2, ……, dj, d, dj+1, …..dn in that order without using the header.
b) Explain about the use and representation of header node in linked list (4)
7 a) What are the application of vectors. (3)
b) Write an algorithm for deleting a node from a specified position in a circular (6)
queue
PART C
Answer all questions, each carries 3 marks.
8 How will you check the validity of an arithmetic expression using stack (3)
9 Let take initial memory as - (3)
PART D
Answer any two full questions, each carries 9 marks.
12 Convert the following expression into its corresponding post fix form using the (9)
prescribed algorithm:
(300+23)*(43-21)/(84+7). Do the evaluation of resultant postfix expression.
Page 1 of 2
D D7144
14
/ \
2 11
/\ /\
1 3 10 30
/ /
7 40
What is the output obtained after preorder, inorder and postorder traversal of the
following tree.
b) Write the non-recursive algorithm for post order traversal of tree. (4.5)
14 a) Write a function( C/ pseudo code ) to insert an element into BST. (4)
b) Write a program in C to check a particular sub string is present in a given string (5)
or not? If found print its location.
PART E
Answer any four full questions, each carries 10 marks.
15 a) Draw the directed graph that corresponds to this adjacency matrix: (5)
0 1 2 3
0 | true false true false |
1 | true false falsefalse |
2 | false falsefalse true |
3 | true false true false |
b) Give the algorithm for BFS graph traversal. (5)
16 a) Show all the passes using insertion sort for the following list (5)
54,26,93,17,77,31,44,55,20
b) Write a function (C/ pseudo code) of heap sort using min heap. (5)
17 Write a program to do the partition of a list using quick sort and then use (10)
insertion sort for sorting sub lists. Explain it with example.
18 a) Write a program of binary search which tells how many comparisons it did to (7)
search an element given as user input.
b) Do the performance comparisons of Linear search and Binary search. (3)
19 Consider a hash table of size 7 and hash function h(k)= k mod 7. Draw the table
that results after inserting in the given order, the following values.
19,26,13,48.17 for each of the three scenarios.
a) When collisions are handled by separate chaining. (3)
b) When collisions are handled by linear probing. (3)
c) When collisions are handled by double hashing using second hash function h’=5- (4)
(5 mod k).
20 a) Get the hash index in table of size 7 for the following list. 56,43,27,32,3. (3)
b) Do the rehashing when the inserted elements are more than 4. (3)
c) Briefly explain any 2 hasting functions. (4)
****
Page 2 of 2