Changes
From Biolecture.org
Created page with "<p>#include<iostream><br /> #include <vector><br /> #include <algorithm></p> <p>using namespace std;<br /> vector<int> output;</p> <p>int check(int arr[..."
<p>#include<iostream><br />
#include <vector><br />
#include <algorithm></p>
<p>using namespace std;<br />
vector<int> output;</p>
<p>int check(int arr[25][25]){<br />
<br />
for(int i=0;i<25;i++){<br />
for(int j=0;j<25;j++){<br />
if(arr[i][j]>0){<br />
if(arr[i+1][j+1]==1){<br />
arr[i+1][j+1]=arr[i+1][j+1]+arr[i][j];<br />
arr[i][j]=0;<br />
} <br />
}<br />
}<br />
}<br />
return arr[25][25];<br />
}</p>
<p>int main()<br />
{<br />
string sample1 = "AAGAATAGTATTTCGCTTTTTTATA";<br />
string sample2 = "AGAAATAGTATTTCGGTTAATTATA";<br />
int samparray[25][25];<br />
for(int i=0;i<25;i++){<br />
for(int j=0;j<25;j++){<br />
if(sample1[i]==sample2[j]){<br />
samparray[i][j]=1;<br />
} else {<br />
samparray[i][j]=0;<br />
} <br />
}</p>
<p> }<br />
check(samparray);<br />
<br />
for(int i=0;i<25;i++){ <br />
for(int j=0;j<25;j++){<br />
<br />
cout<<samparray[i][j]<<" "; <br />
}<br />
cout <<endl;<br />
}<br />
cout <<"The contigs sorting..." << endl;<br />
<br />
for(int i=0;i<25;i++){<br />
for(int j=0;j<25;j++){<br />
if(samparray[i][j]>0){<br />
int a = samparray[i][j];<br />
output.push_back(a);<br />
} <br />
}<br />
} <br />
<br />
sort(output.begin(),output.end());<br />
for(int i=output.size()-1;i>=0;i--){<br />
cout<<output[i]<<endl;<br />
}<br />
</p>
<p>}<br />
</p>
#include <vector><br />
#include <algorithm></p>
<p>using namespace std;<br />
vector<int> output;</p>
<p>int check(int arr[25][25]){<br />
<br />
for(int i=0;i<25;i++){<br />
for(int j=0;j<25;j++){<br />
if(arr[i][j]>0){<br />
if(arr[i+1][j+1]==1){<br />
arr[i+1][j+1]=arr[i+1][j+1]+arr[i][j];<br />
arr[i][j]=0;<br />
} <br />
}<br />
}<br />
}<br />
return arr[25][25];<br />
}</p>
<p>int main()<br />
{<br />
string sample1 = "AAGAATAGTATTTCGCTTTTTTATA";<br />
string sample2 = "AGAAATAGTATTTCGGTTAATTATA";<br />
int samparray[25][25];<br />
for(int i=0;i<25;i++){<br />
for(int j=0;j<25;j++){<br />
if(sample1[i]==sample2[j]){<br />
samparray[i][j]=1;<br />
} else {<br />
samparray[i][j]=0;<br />
} <br />
}</p>
<p> }<br />
check(samparray);<br />
<br />
for(int i=0;i<25;i++){ <br />
for(int j=0;j<25;j++){<br />
<br />
cout<<samparray[i][j]<<" "; <br />
}<br />
cout <<endl;<br />
}<br />
cout <<"The contigs sorting..." << endl;<br />
<br />
for(int i=0;i<25;i++){<br />
for(int j=0;j<25;j++){<br />
if(samparray[i][j]>0){<br />
int a = samparray[i][j];<br />
output.push_back(a);<br />
} <br />
}<br />
} <br />
<br />
sort(output.begin(),output.end());<br />
for(int i=output.size()-1;i>=0;i--){<br />
cout<<output[i]<<endl;<br />
}<br />
</p>
<p>}<br />
</p>