0% found this document useful (0 votes)
17 views3 pages

DAATut 5

This document provides a step-by-step solution to a problem involving dynamic programming. It involves finding the longest common subsequence between two strings, S1 = "abd aa ce" and S2 = "bab ce". The longest common subsequence is determined to be "b a c e" with a length of 4.

Uploaded by

PUBG Noob
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)
17 views3 pages

DAATut 5

This document provides a step-by-step solution to a problem involving dynamic programming. It involves finding the longest common subsequence between two strings, S1 = "abd aa ce" and S2 = "bab ce". The longest common subsequence is determined to be "b a c e" with a length of 4.

Uploaded by

PUBG Noob
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/ 3

Name Riya Prem arajan eCchiat |Camlin Page

Roll no: Y6 Date

Tutorial no:5
Probiem solunq on Dynarte prcqraming
=5kg n=4
5 w (2,3, 4,5)
Pi (3, 4,5,6)
Sve
W->
problem using 0l knapsack
|I2
2 33

2. |O3 3 3

3 2 4464|7
4| 5 7
5 4 O o3 457

maz (y +o,3) mar (5+,9)


mar(4+0 3) maz (5+0, 7)
mar (4 t3, 3) mar (6(6tO, 7)
20

7 3

30
A B
4xlo (Ox3 3x12
MCI,]-0
Ml2,2.]-0
M[3,3]=0
2

1 o 120 264
10 2 360

M21 MI31
ABC
15 4x103 ACBC) CAB) c
j20
MLI tM[Z,3)
=84D
M[2,3I
20 iox3 8x)2 (AB)
iOx3x2 MI2]+ M[3,31
F36O |2Ot Ot yx3x )2
|20+l44
=264
25

30
|CarnlinPage
Date

hnd t onqest- common subse quince by consi dluny


SI= co
abd aa ce B S2 bab ce

Si b.a. b

le2 2 2
d (4 24| 22<
222k2
10 |a3
3<
24|2<34 length of common
142^2< Subsequence=y

b a C e' the
is the
e is qest
longest co mmOn
Sub sequunc!
15

You might also like