Package Struct


package Struct
The Struct package is a versatile collection of data structures designed for competitive programming. It includes advanced structures that are highly optimized to tackle complex problems, as well as classes meant for conveniently managing data.

Included Data Structures:

  • BSTNode - Represents a node in a Binary Search Tree (BST).
  • DSU - Implements a Disjoint Set Union (also known as Union-Find), useful for keeping track of a partition of a set into disjoint subsets.
  • ListNode - Defines a node for a doubly linked list, commonly used in various list operations.
  • SegTree - Implements a Segment Tree, a data structure for efficient query and update operations on array intervals.
  • Trie - Implements a Trie (or prefix tree), which is an ordered tree data structure used for efficient String lookup
  • Single - Encapsulates a single value within an object, sometimes useful for passing mutable values to methods or storing in collections.
  • Pair - Generic class for a tuple of two items, often used to store two related objects together without creating a specific class.
  • Triple - Generalizes Pair to include three related elements, allowing the association of three objects.
  • Quad - Extends the concept of Pair to include four related elements, useful for complex state or result capturing.

Use these data structures to increase the efficiency and readability of your competitive programming solutions.

Since:
1.0
Version:
1.0
Author:
Sahasrad Chippa