48
правок
Изменения
Типы данных в локальных переменных псевдокода
'''double''' ArithmeticCoding(s: '''string'''):
'''double''' left = 0 '''double''' right = 1
'''for''' i = 0 '''to''' length(s)-1
'''char''' symb = s[i] '''double''' newRight = left + (right - left) * segment[symb].right '''double''' newLeft = left + (right - left) * segment[symb].left
left = newLeft
right = newRight
<code>
'''string''' ArithmeticDecoding(code: '''double'''):
'''string''' s = ""
'''for''' i = 1 '''to''' length
'''for''' j = 1 '''to''' n