Package Util
package Util
The
Util
package offers specialized classes for algorithmic operations
data manipulation, mathematical computations, and standardized input/output handling.
The design of these tools focuses on efficiency, simplicity, and flexibility for
competitive programmers/
Classes included in this package:
Algo
- Provides static methods for efficient algorithmic operations such as binary and ternary searches, supporting operations with generic data types.Calc
- Offers a series of static methods for complex mathematical computations including modular inverses, exponentiation, and more.Constants
- Centralizes commonly used constants and configurations needed in competitive programming, such as modulo values and debug flags.Data
- Delivers utility methods for data manipulation, like finding min/max values, and calculating prefix and suffix sums across various data types.In
- Facilitates input operations from different sources (System.in
by default) with support for parsing primitive types and strings, as well as custom tokenization.Out
- Handles output operations efficiently with capabilities for stream redirection, custom delimiters, and deferred flushing to maintain runtime performance.
This package is structured to provide productivity boosts in competitive programming by reducing boilerplate code and enhancing the performance of common computational and I/O tasks.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Sahasrad Chippa
-
ClassesClassDescriptionProvides static methods for efficient algorithmic operations like binary search and ternary search on arrays and lists.The Calc class provides a series of static methods for performing various mathematical computations like modular inverses, exponentiation, factorial, combinations, greatest common divisor (GCD), least common multiple (LCM), and Euler's Totient function.Constants provides a central location to keep commonly used constants and configurations in competitive programming.Provides utility methods for data manipulation, including finding minimum and maximum values, calculating prefix and suffix sums, and performing binary search operations on arrays and lists.This class provides methods for input operations from various sources such as system input, files, and streams, and supports the parsing of primitive types and strings, including array and list formats.This class serves as a utility for output operations, allowing for redirection of output streams, file output, custom delimiters, and built-in support for printing various data types, including arrays and collections.