Documentation of 'edu.princeton.cs.algs4.RunLength' Java class
RunLength
edu.princeton.cs.algs4

Class RunLength



  • public class RunLength
    extends java.lang.Object
    The RunLength class provides static methods for compressing and expanding a binary input using run-length coding with 8-bit run lengths.

    For additional documentation, see Section 5.5 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void compress()
      Reads a sequence of bits from standard input; compresses them using run-length coding with 8-bit run lengths; and writes the results to standard output.
      static void expand()
      Reads a sequence of bits from standard input (that are encoded using run-length encoding with 8-bit run lengths); decodes them; and writes the results to standard output.
      static void main(java.lang.String[] args)
      Sample client that calls compress() if the command-line argument is "-" an expand() if it is "+".
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • expand

        public static void expand()
        Reads a sequence of bits from standard input (that are encoded using run-length encoding with 8-bit run lengths); decodes them; and writes the results to standard output.
      • compress

        public static void compress()
        Reads a sequence of bits from standard input; compresses them using run-length coding with 8-bit run lengths; and writes the results to standard output.
      • main

        public static void main(java.lang.String[] args)
        Sample client that calls compress() if the command-line argument is "-" an expand() if it is "+".
        Parameters:
        args - the command-line arguments

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.