Dynamic-Programming
Missing docstring for knapsack_solver
. Check Documenter's build log for details.
Missing docstring for lis_length
. Check Documenter's build log for details.
Missing docstring for minumum_operations
. Check Documenter's build log for details.
AlgorithmsCollection.number_of_steps
— Functionnumber_of_steps(distance::Int64, step_size::Int64)
Number of stepsize is calculating the total number of combinations for walking a distance
for a given number of stepsize. For example, for a distance
of 3 with a maximum step_size
of 3 will provide for possible combinations:
- 1 step + 1 step + 1 step
- 1 step + 2 step
- 2 step + 1 step
- 3 step
Arguments
distance::Int64
: Distance to gostep_size::Int64
: Maximum step size of walking a distance
Examples
julia> import ClassicAlgorithmsCollections
julia> ClassicAlgorithmsCollections.number_of_steps(8,3)
81
AlgorithmsCollection.subset_sum_test
— Functionsubset_sum_test(array::Array{Int64,1}, target::Int64)
The recursive expression tests if there is a subset in the array, where the sum of the subset is equal to the target
.
Arguments
array::Array{Int64,1}
: Array with a possible sum of a subsequence.target::Int64
: Target sum of the subsequence, which should be included in the array.
Examples
julia> import ClassicAlgorithmsCollections
julia> set = [3, 34, 4, 12, 5, 2]
julia> sum = 9
julia> ClassicAlgorithmsCollections.subset_sum_test(set, sum)
true