Search found 2 matches

by Mishi Rahman
Sat Dec 07, 2013 4:38 pm
Forum: Volume 104 (10400-10499)
Topic: 10405 - Longest Common Subsequence
Replies: 103
Views: 44258

whats wrong with my code?? um getting TL!

#include<stdio.h>
#include<string.h>

long int c[1002][1002];
int d,e;
void LCS(char x[],char y[],int l,int k)
{
int i,j;
for(i=0;i<=l;++i)
c [0]=0;

for(j=0;j<=k;++j)
c[0][j]=0;

for(i=1;i<=l;++i)
for(j=1;j<=k;++j)
{
if(x ==y[j])
c [j]=(c[i-1][j-1])+1;

else if(c[i-1][j]>=c [j-1])
c [j]=c[i-1][j ...
by Mishi Rahman
Sat Dec 07, 2013 4:37 pm
Forum: Volume 104 (10400-10499)
Topic: 10405 - Longest Common Subsequence
Replies: 103
Views: 44258

Re: 10405 - Longest Common Subsequence

#include<stdio.h>
#include<string.h>

long int c[1002][1002];
int d,e;
void LCS(char x[],char y[],int l,int k)
{
int i,j;
for(i=0;i<=l;++i)
c [0]=0;

for(j=0;j<=k;++j)
c[0][j]=0;

for(i=1;i<=l;++i)
for(j=1;j<=k;++j)
{
if(x ==y[j])
c [j]=(c[i-1][j-1])+1;

else if(c[i-1][j]>=c [j-1])
c [j]=c[i-1][j ...

Go to advanced search