Wireless Communications and Mobile Computing / 2020 / Article / Alg 1

Research Article

A Lossless Compression Approach Based on Delta Encoding and T-RLE in WSNs

Algorithm 1

T-RLE pseudocode.
While is not EOF do
    repetition =0
    Repeat
       get input Character;
       repetition = repetition + 1
    Until Character unequal to next Character
    If repetition < 2 do
       output1 << character,
    If repetition =2 do
       output1 << character&
    If repetition > 2 do
       output1 << character⌴
       output2 << repetition
End while

Article of the Year Award: Outstanding research contributions of 2020, as selected by our Chief Editors. Read the winning articles.