mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-04 02:56:40 +08:00
Update backtracking/subarray_sum.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* @brief We are given with an array and a sum value. The algorithms find all
|
* @brief [Subset-sum](https://en.wikipedia.org/wiki/Subset_sum_problem) (only continuous subsets) problem
|
||||||
* the subarrays of that array with sum equal to given sum and return such
|
* @details We are given an array and a sum value. The algorithms find all
|
||||||
|
* the subarrays of that array with sum equal to the given sum and return such
|
||||||
* subarrays count. This approach will have \f$O(n)\f$ time complexity and
|
* subarrays count. This approach will have \f$O(n)\f$ time complexity and
|
||||||
* \f$O(n)\f$ space complexity. NOTE: In this problem, we are only refering to
|
* \f$O(n)\f$ space complexity. NOTE: In this problem, we are only referring to
|
||||||
* the continuous subsets as subarrays everywhere. Subarrays can be created
|
* the continuous subsets as subarrays everywhere. Subarrays can be created
|
||||||
* using deletion operation at the end or the front of an array only. The parent
|
* using deletion operation at the end of the front of an array only. The parent
|
||||||
* array is also counted in subarrays having 0 number of deletion operations.
|
* array is also counted in subarrays having 0 number of deletion operations.
|
||||||
* @details Subset sum(only continuous subsets) problem
|
*
|
||||||
* (https://en.wikipedia.org/wiki/Subset_sum_problem)
|
|
||||||
* @author [Swastika Gupta](https://github.com/Swastyy)
|
* @author [Swastika Gupta](https://github.com/Swastyy)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user