基于单词的文本压缩与文本图像压缩技术解析
1. 递归过程 RowCol
以下是递归过程 RowCol 的代码:
procedure RowCol(ind,R1,R2,C1,C2: integer);
case ind of
0: R2:=(R1+R2)÷2; C2:=(C1+C2)÷2;
1: R2:=(R1+R2)÷2; C1:=((C1+C2)÷2) + 1;
2: R1:=((R1+R2)÷2) + 1; C2:=(C1+C2)÷2;
3: R1:=((R1+R2)÷2) + 1; C1:=((C1+C2)÷2) + 1;
endcase;
if ind≤n then RowCol(ind+1,R1,R2,C1,C2);
end RowCol;
main program
integer ind, R1, R2, C1, C2;
integer array id[10];
bit array M[2n, 2n];
ind:=0; R1:=0; R2:=2n −1; C1:=0; C2:=2n −1;
RowCol(ind, R1, R2, C1, C2);
M[R1,C1]:=1;
end;
这个递归过程 RowCol 主要用于对矩阵的行和列进行划分操作,根据 ind 的不同取值,对 R1 、 R2 、 C1 和 C2 进行不同的计算,并且在 ind 小
超级会员免费看
订阅专栏 解锁全文
1281

被折叠的 条评论
为什么被折叠?



