You are on page 1of 2

V Sem CSE End-Sem Lab Exam 2011 DAA Name :_______________________ Section ___ Roll No _______________

Note 1. Possessing any kind of ELECTRONIC GADGETS is considered as MALPRACTICE. 2. Do NOT seek any clarifications from the EXAMINER(s) 3. Call the examiner for evaluation only ONCE when you feel that experiment is complete 4. You are NOT permitted to make changes to your programs once you call the examiner for evaluation. 5. Do NOT WRITE anything on this paper except your Name and Roll No. and Sec 6. Exploring other than EXAM DIRECTORY is considered as MALPRACTICE

Design question Write a program to do the following 1. Identify the patterns DESIGN followed by ANALYSIS in the given random text such as DESIGN * ANALYSIS *. Here, * represents any random sequence of characters but not DESIGN or ANALYSIS. Implement a brute force technique to display the patterns followed by their indices. 2. Imagine a long text containing the substrings DESIGN and ANALYSIS along with other random sequence of characters. For all possible pair of patterns DESIGN and ANALYSIS in the text, it is required to perform the action as detailed below. Task numbers 2(a) 2(b) 2(c) 2(d) Pattern occurrences DESIGN followed ANALYSIS ANALYSIS followed DESIGN DESIGN followed DESIGN ANALYSIS ANALYSIS followed Action by Retain the sequence by Exchange the pattern such that the output is DESIGN followed by ANALYSIS by Remove the second occurrence and replace it by the pattern ANALYSIS by Remove the first occurrence and replace it by the pattern DESIGN

Implement brute-force technique and test it on the text given below. DESIGN * ANALYSIS * ANALYSIS * ANALYSIS * DESIGN * DESIGN * ANALYSIS * DESIGN The output should be DESIGN *ANALYSIS * DESIGN * ANALYSIS * DESIGN * ANALYSIS * DESIGN * ANALYSIS. Evaluation Scheme: The marking scheme is shown below: Write-up
1 (04) 2(a) (03) 2(b) (03) 2(c) (03) 2(d) (02) Total (15)

Execution
1 (07) 2(a) (05) 2(b) (05) 2(c) (05) 2 (d) (03) Total (25)

Signature of student:

You might also like