This commit is contained in:
2024-04-24 15:33:33 -07:00
parent 8269bf1135
commit 0bfe54d69b
4 changed files with 37 additions and 9 deletions

View File

@ -21,7 +21,8 @@ Pointers take the form \texttt{<pos, len>}, where \texttt{pos} is the position o
For example, we can encode the string \texttt{ABRACADABRA} as \texttt{[ABRACAD<7, 4>]}. \par
The pointer \texttt{<7, 4>} tells us to look back 7 positions (to the first \texttt{A}), and copy the next 4 symbols. \par
Note that pointers refer to the partially decoded output---\textit{not} to the encoded string. \par
This allows pointers to reference other pointers, and ensures that codes like \texttt{A<1,9>} are valid.
This allows pointers to reference other pointers, and ensures that codes like \texttt{A<1,9>} are valid. \par
\note{For example, \texttt{[B<1,2>]} decodes to \texttt{BBB}.}
\problem{}
Encode \texttt{ABCD$\cdot$ABCD$\cdot$BABABA$\cdot$ABCD$\cdot$ABCD} using this scheme. \par