Professional Documents
Culture Documents
DSA - Pattern Matching
DSA - Pattern Matching
DSA - Pattern Matching
D o t e : G//22
Am: Write o prognam or Patfenn Motchicg
5oftuaoe Requiod ova Online Cormpile
Prognom_Code
include<stdio.h>
Einclude<slring. h>
void se anch (Chan po, chan txt)
in M=strle n(pal)
nt N
stnlen (+xt)
fonCint 70 1<= N- M, ++)
on (j- o, js m i++)
f (t +57-po )
break
i n t main )
iat main)
char *xtAABAACAADAARAAA BAA
chan pat=AABA
SeanchLpattxt
peuna0
Output: Patlena ound at iodex o
Patkennfound ot iodtx
Patten aunol atedex 13
Conclu6lan Pa no Matchinq lets uo angaoize the cad as
metehin9 patlenns tbeexecukd when the
paffenn mateh is found.