Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Segment 1: Answer any 1 (one) question from Q(1-3): 6 marks

1. Consider the pattern P = aba2b. Construct the table and the corresponding labeled directed
graph used in the “fast” pattern matching algorithm.
2. Consider the pattern P = a3bba. Construct the table and the corresponding labeled directed
graph used in the “fast” pattern matching algorithm.
3. Consider the pattern P = abc. Construct the table and the corresponding labeled directed graph
used in the “fast” pattern matching algorithm.

Segment 2: Answer any 1 (one) question from Q(4-6): 6 marks


4. Consider the pattern P = abc. Using the “slow” the slow pattern matching algorithm, find the
number C comparisons to fin the INDEX of P in (aba)10.
5. Consider the pattern P = abc. Using the “slow” the slow pattern matching algorithm, find the
number C comparisons to fin the INDEX of P in (cbab)10.
6. Consider the pattern P = abc. Using the “slow” the slow pattern matching algorithm, find the
number C comparisons to fin the INDEX of P in dn where n>3.

Segment 3: Answer any 1 (one) question from Q(7-9): 6 marks


7. Find (a) INSERT (‘The boy’, ‘5’, ‘Big ’), (b) DELETE (‘AAABBB’, 3, 3), (c) REPLACE
(‘ABABAB’, ‘B’, ‘BAB’)
8. Find, (a) INSERT (‘The boy’, ‘ 7’, ‘’), (b) DELETE (AAABBB’, 1, 4), (c) REPLACE (‘Data
Structure’, ‘Structure’, ‘mining’),
9. Find, , (a) INSERT (‘The boy’, ‘’, ‘’), (b) DELETE (“Data Structure”, 1, 5), (c) REPLACE
(‘Data Structure’, ‘ ’, ‘ ’)

Segment 4: Answer any 1 (one) question from Q(10-12): 6 marks


10. Consider the multidimensional array X (-5:5, 5:10, 3:33). (a) Find the length of the each
dimension and the number of elements in X. (b) Suppose Base(X) = 1000 and word per
memory location is 5. Find the efficient indices E1, E2, E3 an the address of X(5, 10, 10)
assuming X is sorted in i) row-major order and ii) column-major order.
11. Consider the multidimensional array X (3:10, 1:15, 10:20). (a) Find the length of the each
dimension and the number of elements in X. (b) Suppose Base(X) = 400 and word per memory
location is 4. Find the efficient indices E1, E2, E3 an the address of X(5, 10, 15) assuming X is
sorted in i) row-major order and ii) column-major order.
12. Consider the multidimensional array X (-5:5, 5:10, 3:33). (a) Find the length of the each
dimension and the number of elements in X. (b) Suppose Base(X) = 1000 and word per
memory location is 5. Find the efficient indices E1, E2, E3 an the address of X(-5, 5, 33)
assuming X is sorted in i) row-major order and ii) column-major order.

Segment 5: Answer any 1 (one) question from Q(13-15): 6 marks


13. Discuss the advantages and disadvantages of using array as data structure with appropriate
examples.
14. Discuss the advantages and disadvantages of using linked list as data structure with appropriate
examples.
15. Discuss the ADT, Time-space trade off, and Garbage collection with appropriate examples.

You might also like