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

Datastructures 2022

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

Datastructures 2022

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

Name of the Candidate: Reg. No.

:
21IT340
B.TECH. DEGREE– NOVEMBER 2022 –EXAMINATIONS
BRANCH:INFORMATION TECHNOLOGY
DATA STRUCTURES
Duration : 3Hours Maximum: 100 Marks

Answer All Questions


PART – A (20 Marks) CO Marks
A1. Write procedure(s) for overflow and underflow conditions of Stack CO1 (4)
A2. Explain properties of Priority Queue (Binary Heap) with example. CO2 (4)
A3. Explain different factors involved in Hash Table design. CO3 (4)
A4. (i) Define Big Oh notation (2) CO4 (4)
(ii) Rank the following time complexities: en, 2n, n log n, n! in ascending order. (2)
A5. (i) Explain how does insertion sort vary from bubble sort. (2) CO5 (4)
(ii) List different data structures and techniques used in external sorting (2)
PART – B (40 Marks) CO Marks
B1. Write procedures to create linked list for a string such that each node has a CO1 (6)
character. Connect first and last nodes, if the character is same and delete one
node. Give diagrammatic representation(s). (3 + 3)
B2. Perform dry run for the following statements and determine the contents of queues CO1 (6)
Q1 and Q2, and Stack S. Give diagrammatic representation(s).
S = createStack();
Q1 = createQueue();
Q2 = createQueue();
loop // x takes the value 5, 6, 9, 0, 7, 5, 0, 2, 6 one by one for each iteration.
enqueue(Q1, x); // inserts x into Queue
end loop
loop (not emptyQueue (Q1) )
dequeue(Q1, x); // removes item from Queue and stores it in x
if (x == 0)
z =0;
loop (not emptyStack(S) )
popStack(S,y);
z = z + y;
end loop;
enqueue(Q2, z);
else
pushStack(S, x);
end if
B3. (i) Insert the following birds into empty AVL tree one by one. Explain the rotations CO2 (16)
involved during the insertion process. peacock, myna, parrot, dove and crow. (4)
(ii) Update the AVL tree with three more birds like turtle, vulture and eagle. Does
this update involve any rotation process? Explain. (4)
(iii) Find the smallest bird in the list given. Write procedure (4)
(iv) Delete the bird ‘dove’ from the AVL tree. Explain. (4)
B4. Assume we have set of items S = { 1, 3, 5, 7, 9, 11, 13, 15}. Determine the CO3 (6)
partitions of S after performing the operations: union(1,5), union(3,7), union(3,9),
union(5,10), union(10,15). Check whether 1 and 15 are connected. Explain the
procedure(s) involved in the operations.
B5. Describe how divide and conquer strategy is used in Merge Sort algorithm. Use this CO5 (6)
sorting procedure to sort the numbers 18, 36, 27, 90, 45, 54, 72.
Contd……………
PART – C (40 Marks) CO Marks
C1. Use Stack ADT operations to convert the given infix expression a + (b – c) * d + e CO1 (10)
into postfix expression and then evaluate it when a=b=1, c=d=e=2. (6 + 4)
[OR]
C2. Assumes the linked list L is created for numbers such that each node contains a CO1 (10)
number. Write procedures to (i) separate the odd numbered and even numbered
nodes from L into L_Odd and L_even respectively (ii) update the linked lists with
unique numbers by removing duplicates (iii) count the number of nodes present in
the lists (4+3+3)

C3. (i) List the properties of B-tree (2) CO2 (10)


(ii) Build B-tree of order 5 for the following items:
44, 11, 22, 33, 18, 25, 94, 65, 78, 100, 54, 38 (6)
(iii) Delete any two keys from the root node one by one (2)
[OR]
C4. (i) Construct an expression tree for the given expression a b + c d - *. CO2 (10)
Determine preorder and inorder expressions. (3)
(ii) Build minHeap for the following numbers: 40, 60, 30, 10, 20, 70 (4)
(iii) Does 30 change its position after its insertion? Explain (1)
(iv) Perform one delete operation in the heap (2)

C5. Insert the items 37, 44, 55, 69, 27 into the Hash table of size 7, h(k) = k mod T CO3 (5)
using linear probing strategy (f(i) =i) and quadratic probing strategy (f(i)=i2).
[OR]
C6. Insert the items 18, 105, 71, 24, 68 into the Hash table of size 7, h(k) = k mod T, CO3 (5)
linear probing strategy (f(i) =i) and load factor 50%. Perform rehashing with the
table size 13. (2 + 3)

C7. Determine the space and time complexity involved in the given code. (2 + 3) CO4 (5)
for (i = 0; i < P; i++)
{
for (j = 0; j < Q; j++) {
sequence of statements
}
for(k = 0; k< R; k++){
sequence of statements
}
}
[OR]
C8. Write binary search algorithm for the set of array elements. Determine the space CO4 (5)
and time complexity involved in it. (3 + 1 + 1)

C9. Identify 2 different data structures to check whether the given string is palindrome CO6 (10)
or not. Select one structure with suitable justification. Write procedure(s) and
explain with diagrams. (4 + 4 + 2)
[OR]
C10. Demonstrate Selection sort and Quick sort for the given numbers. Identify suitable CO6 (10)
sorting algorithm and give justification. Write procedure(s)
29, 19, 59, 39, 99, 79, 49 (4 + 4 + 2)
***************

You might also like