Vous êtes sur la page 1sur 2

SUBJECT TITLE: ALGORITHM ANALYSIS AND DESIGN Assignment II CSE (IV Semester) Last date of submission:10-4-2012 Q1: Find

d an optimal solution to the knapsack instance n=7, m=15 (P1, P2, P3, P4, P5, P6, P7)=(10,5,15,7,6,18,3) & (w1,w2,w3,w4,w5,w6,w7)=(2,3,5,7,1,4,1). Q2: What is an optimal Huffman code for the following set of frequencies based on first 8 Fibonacci numbers? Compare the number of bits required using fixed length codes & variable length codes. a b c d e f g h freq in1000 1 1 2 3 5 8 13 21

Q3 what is activity selection problem? Find out the set which contain the maximum number of activities which are compatible. Ai 1 2 3 4 5 6 7 Si 2 1 2 4 5 5 8 Fi 5 2 4 6 8 9 10 Q4: Solve the task scheduling problem & also find the penality. Ai Di Pi 1 4 30 2 5 40 3 2 50 4 4 70 5 6 80 6 2 60

Q5: Find the shortest path matrix for the graph whose weight matrix is given D= 0 0 0 2 0 3 0 4 0 0 8 0 0 -5 0 0 1 0 0 6 -4 7 0 0 0

Q6: Construct string matching automaton for pattern P=aabab and illustrate its operation on the text T= aaababaabaabab. Q7: Working modulo q=11,how many spurious hits does the Rabin Karp matcher encounter in the text T= 3141592653589793.

Vous aimerez peut-être aussi