Class GetAdditionFromList
java.lang.Object
topics.foundation.sum.GetAdditionFromList
Array Summation
Provides a sequential mathematical utility to calculate the aggregate sum of all elements contained within a one-dimensional integer array.
Complexity
- Time Complexity:
O(N)- Requires a single linear traversal evaluating every element in the array exactly once. - Space Complexity:
O(1)- The evaluation requires a strictly constant amount of auxiliary memory, operating independently of the array's dimension.
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintsum(int[] numbers) Computes the total aggregate value of the provided sequence of integers.
-
Constructor Details
-
GetAdditionFromList
public GetAdditionFromList()
-
-
Method Details
-
sum
public int sum(int[] numbers) Computes the total aggregate value of the provided sequence of integers.- Parameters:
numbers- The integer array to be evaluated.- Returns:
- The exact mathematical sum of all elements within the array.
-