-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Additional algorithm 12.html
63 lines (44 loc) · 3.17 KB
/
Additional algorithm 12.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!-- ############################################################################################################################## -->
<!-- # John Wiley & Sons, Inc. # -->
<!-- # # -->
<!-- # Book: Algorithms in Bioinformatics: Theory and Implementation # -->
<!-- # Author: Dr. Paul A. Gagniuc # -->
<!-- # # -->
<!-- # Institution: # -->
<!-- # University Politehnica of Bucharest # -->
<!-- # Faculty of Engineering in Foreign Languages # -->
<!-- # Department of Engineering in Foreign Languages # -->
<!-- # # -->
<!-- # Area: European Union # -->
<!-- # Date: 04/01/2021 # -->
<!-- # # -->
<!-- # Cite this work as: # -->
<!-- # Paul A. Gagniuc. Algorithms in Bioinformatics: Theory and Implementation. John Wiley & Sons, 2021, ISBN: 9781119697961. # -->
<!-- # # -->
<!-- ############################################################################################################################## -->
<script>
var s0 = 'TAGCCCTATCGGTCA';
var s1 = 'TACGGG';
var m = [];
var s = [];
s[0] = [] = s0.split('');
s[1] = [] = s1.split('');
var n_0 = s[0].length+1;
var n_1 = s[1].length+1;
document.write('Traversing a matrix on columns by using one loop:<br>');
var i = 0;
var j = 0;
for(var v=0; v<=(n_0*n_1)-1; v++) {
i = v % n_0;
if(i==0 && v!=0 && j<n_1 && v!=(n_0*n_1)){j+=1;}
document.write('m[' + i + '-' + j + ']<br>');
}
document.write('Traversing a matrix on rows by using one loop:<br>');
var i = 0;
var j = 0;
for(var v=0; v<=(n_0*n_1); v++) {
j = v % n_1;
if(j==0 && v!=0 && i<n_0 && v!=(n_0*n_1)){i += 1;}
document.write('m[' + i + '-' + j + ']<br>');
}
</script>