Bölüm 5 · SimülatörString Compression Algorithms? ← Bölüm 5 Input RLE LZW Prepare Next Step Auto Run ResetPress Prepare to start.Compressed OutputRatio: —Not available yet.RunsRuns will appear here.KapatString Compression AlgorithmsVisualize Run Length Encoding (RLE) and Lempel-Ziv-Welch (LZW) step by step.How to useType an input text (up to 24 characters) and choose an algorithm. Changing the algorithm loads a matching example.Prepare generates all steps; Next Step advances one step, Auto Run plays the rest, Reset clears the run.Yellow cell: the character being processed. Green cells: the current run (RLE).The bottom line keeps the last few steps; the ratio appears when the run is complete.Run Length Encoding (RLE)RLE replaces each run of repeated symbols with a count-symbol pair, for example AAAAABB → 5A2B. It works well when the input contains long runs and can make the output longer when it does not.Lempel-Ziv-Welch (LZW)LZW starts with a dictionary of the single characters of the input. While scanning, it extends the current sequence w with the next character c. If wc is already in the dictionary, w = wc; otherwise it outputs the code of w, adds wc as a new code and restarts with w = c. The dictionary grows as new sequences appear.In the Dictionary panel the green entry is the current w, the yellow entry is the code added in this step.Compression ratioRatio = compressed units / original units. For RLE the units are the characters of the output tokens; for LZW they are the emitted codes.ComplexityAlgorithmTimeExtra spaceRLEO(n)O(1) besides outputLZWO(n) expected (hash dictionary)O(n) dictionary