Model Question Paper-Data Structures CST 201 KTU
Model Question Paper
QP CODE: PAGES:3
Reg No:_______________
Name:_________________
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY THIRD SEMESTER B.TECH
DEGREE EXAMINATION, MONTH & YEAR
Course Code: CST 201
Course Name: DATA STRUCTURES
Max.Marks:100 Duration: 3 Hours
PART A
Answer all Questions. Each question carries 3 Marks
1. Calculate the frequency count of the statement x = x+1; in the following code segment
for (i = 0; i< n; i++)
for (j = 0; j< n; j*=2)
x = x + 1;
2. What is the relevance of verification in System Life Cycle?
3. Write an algorithm to insert a new element in a particular position of an array.
4. Convert the expression ((A/(B-D+E))*(F-G)*H) to postfix form. Show each step in the conversion including the stack contents
5. Write an algorithm to count the number of occurrences of a character in a linked list (each node contains only one character)
6. Write an algorithm for best-fit method of memory allocation
7. Draw the binary tree whose sequential representation is given below
8. Find the Depth First Search of the following Graph
9. Write an algorithm to arrange n numbers in nonincreasing order.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A B C - D E - - - - F G - - -
8. Find the Depth First Search of the following Graph
9. Write an algorithm to arrange n numbers in nonincreasing order.
10. Let the size of a hash table is 10. The index of the hash table varies from 0 to 9. Assume
the keys 73, 54, 15, 48, 89, 66, 37, 18, 41, 22, 62 are mapped using modulo operator.
Show how the keys are distributed using chaining method.
Part B
Answer any one Question from each module. Each question carries 14 Marks
11. a) Explain the System Life Cycle in detail (10)
b) How the performance of an algorithm is evaluated? (4)
OR
12. a) Write algorithms for Linear Search and Binary Search and Compare their time
complexities (10)
b) Between O(nlogn) and O(logn) which one is better and why? (4)
13. a) Write algorithms to insert and delete elements from a double ended queue.
Demonstrate with examples (10)
b) Compare and contrast Circular Queue with a Normal Queue (4)
OR
14. a) Write an algorithm to insert and delete elements from a Priority Queue (8)
b) Discuss an algorithm to convert an infix expression to a prefix expression (6)
15. a) Write an algorithm to multiply two polynomials represented using linked list (10)
b) How doubly linked list can be used to find palindromes ? (4)
OR
16. a) How is memory compaction (de-allocation) done in memory management ? (8)
b) Discuss the advantages and disadvantages of First-fit, Best-fit and Worst-fit allocation
schemes (6)
17. a) List the properties of Binary Search Tree. Write an algorithm to search an element
from a Binary Search Tree (10)
b) Write an iterative algorithm for in-order traversal of a Binary Tree (4)
OR
18. a) Give algorithms for DFS and BFS of a graph and explain with examples (8)
b) How graphs can be represented in a Computer? (6)
19. a) Write algorithms for Merge sort and Quick Sort. (10)
b) Illustrate the working of Quick sort on the following input 38, 8, 0, 28, 45, -12, 89, 66,
42 (4)
OR
20. a) With examples discuss the different hash functions used for hashing (10)
b) Apply the hash function h(x) = x mod 7 for linear probing on the data 2341, 4234,
2839, 430, 22, 397, 3920 and show the resulting hash table (4)
Comments
Post a Comment