http://michael.dipperstein.com/rle/index.html


Step 1.         Set the previous symbol equal to an unmatchable value.
Step 2.         Read the next symbol from the input stream.
Step 3.         If the symbol is an EOF exit.
Step 4.         Write out the current symbol.
Step 5.         If the symbol is an does not match the previous symbol, set
the previous symbol to the current symbol, and go to step 2.
Step 6.         Read and count additional symbols until a non-matching symbol
is found. This is the run length.
Step 7.         Write out the run length.
Step 8.         Write out the non-matching symbol.
Step 9.         Set the previous symbol to the non-matching symbol, and go to 
step 2.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to