KnapsackUtils class
Item with weight and value.
Constructors
- KnapsackUtils(int weight, int value)
-
Creates a knapsack item with the given
weight(cost) andvalue(profit). Audited: 2026-06-12 11:26 EDTconst
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → int
-
Item value (profit).
Audited: 2026-06-12 11:26 EDT
no setter
- weight → int
-
Item weight (cost).
Audited: 2026-06-12 11:26 EDT
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited