Click or drag to resize
TopM Class
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 MinPQKey of size at most M + 1 to identify the M largest transactions and a LinkedStackItem to output them in the proper order.
Inheritance Hierarchy
SystemObject
  Algs4NetTopM

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class TopM

The TopM type exposes the following members.

Methods
  NameDescription
Public methodStatic memberMainTest
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.
Top
Remarks
For additional documentation, see Section 2.4 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class TopM implementation by Robert Sedgewick and Kevin Wayne.

See Also