0% found this document useful (0 votes)
25 views

btech-cs-3-sem-data-structures-cs205-dec-2023

Good for everyone

Uploaded by

cirilcreji
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

btech-cs-3-sem-data-structures-cs205-dec-2023

Good for everyone

Uploaded by

cirilcreji
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

D 08000cs20512230L

#**T\ -^ gDuC,+t
:,-,r1o.Eujlilr^\-$
;+*|r}kbxC
.Y''--:rr'
RegNo.:
APJ ABDUL KALAM TECHNOLOGICAL
B.Tech Degree 53 (S, FE) / 53 (PT) (S, FE) Examination December

Course Code: CS205


Course Name: DATA STRUCTURES
Max. Marks: 100 Duration:3 Hours
PART A
Answer oll questions, each corries 3 morks. Marks

I . Define BigO notation. Provethat n3 *n * 5 = O(n3 ) (3)

2 Write any three criteria satisfied by an algorithm. (3)


3 Write an iterative algorithm to count total number of nodes in a given singly (3)

linked list.
Represent the polynomial4x3 + 6x2 + l0x + 6 using a linked list. (3)

PART B
Answer any twofull questions, each carries 9 morks.
5 a) Explain stepwise refinement technique. (4.s)
b) Draw the structure of a node in a doubly linked list. Write an algorithm to delete (4.5)
the last node of doubly linked list with an exaniple.
6 a) Describe an algorithm for finding an element x in a list of distinct elements (4.5)
ill,a.2, .., a'n.

b) What is circular linked list? Write an algorithm to insert a node at the beginning (4.5)
of a circular linked list.
a) Compare recursive and iterative algorithms (4.5)

. b) linked
Write an algorithm to add two single variable polynomials represented by (4.5)

list.
PART C
Answer all questions, each carries 3 marks.
8 Convert the infix expression (A + B) / (C - D) - (E * F) into postfix expression. (3)
9 Explain first fit allocation, best fit allocation and worst fit allocation schemes. (3)

l0 Define a complete binary tree. Give one example. (3)


ll Give the non-recursive algorithm for in-order traversal of a binary tree using a (3)
stack.

Page 1 of 3
08000cs205122301

PART D
Answer any tvofull questions, each carries 9 marks.

12 a) Write algorithm for push and pop operations for a stack using array (4.5)

b) Find the in-order, pre-order and post-order traversal of the following binary tree (4.5)

.I 13 a) Assume a queue is implemented using linked list. Write algorithm for the (4.5)

following operations:
(i) Insert an item into the queue
(ii) Delete an item from the queue
b) Create a binary search tree using the following data elements: 45,39' 56, 12,34, (4.5)
78, 32, 10, 89, 54, 67,and 81
14 a) What is a DEQUELJE? Write an algorithm to insert an element into an output
(4.5)
restricted DEQLJELIE.
b) Write a recursive algorithm to insert a node into binary search tree. (4.5)

PART E
Answer onyfoarfull questions, eoch carries 10 marhs.
15 a) Explain the different ways in which a graph can be represented. Give one (6)
example for each.
b) Write an algorithm to perform selection sort. Perform selection sort on an array (4)
:
[6,3,1,8,9]
16 a) Write an algorithm to perform DFS on a graph. (4)

b) Pe{orm DFS on the following graph. Star with node H. ' (6)

Page 2 of 3
08q)0cs20s122301

t7 a) Define the following terms with examples: (i) Min Heap (ii) Max Heap. (2)
b) An array of 6 elements: 15, 19, 10, 7, 17, and 16 is given. Sort it in ascending (8)
order using heap sort.
l8 a) Write the algorithm for binary search. What is its time complexity? (4)
b) Illustrate the following hashing functions with examples: (6)
(i) Division Method.
(ii) Mid Square Method.
(iii) Folding Method.
(iv) Digit Analysis Method.
l9 a). Mention any three disadvantages of hash data structure. (3)
b) How separate chaining prevents collision? Illushate with an example. (7)
20 a) Discuss the different mcthods used for open addressing.
(3)
h\ (7)
Using the hash function 'key mod 7', insert the following sequence of keys in the
hash table.

50, 700, 76, 85, 92, 73 and l0l


Use linear probing technique for collision resolution.

**ti*!t !t

Page 3 of3

You might also like