类 TopM


  • public class TopM
    extends java.lang.Object
    The TopM class provides a client that reads a sequence of transactions from standard input and prints the m largest ones to standard output. This implementation uses a MinPQ of size at most m + 1 to identify the M largest transactions and a Stack to output them in the proper order.

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

    • 方法概要

      修饰符和类型 方法 说明
      static void main​(java.lang.String[] args)
      Reads a sequence of transactions from standard input; takes a command-line integer m; prints to standard output the m largest transactions in descending order.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • main

        public static void main​(java.lang.String[] args)
        Reads a sequence of transactions from standard input; takes a command-line integer m; prints to standard output the m largest transactions in descending order.
        参数:
        args - the command-line arguments