Skip to content

Mugisha-isaac/Dynamic-programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic-programming

Learning Dynamic programming in advance

GridTravella Game program enhanced with it's best time and space complexity

1_C-WAJOlC1a2O0VOeU-mJQA

Tricks to make your program effective with increasing it's time and space complexity

course from Freecodecamp

Time complexity for howSum function

m = target sum n = number time = o(n^m*m)

Space complexity

space = o(m)

Memoized howSum algorith

time = 0(n*m^2)

space = 0(m^2)

Time complexity for bestSum algorithm

m = target sum n = numbers time = o(n^m*m) space = o(m^2)

Memoized complexity for bestSum algorithm

time = o(m^2*n) space = o(m^2)

Time complexity for canConstruct algorthim

m = target.length n= wordbank.length

time = o(n^m) space =o(m^2)

Memoized complexity for canConstruct algorithm

m = target.length n = wordbank.length

time = n*m^2 space = o(m^2)

Time and space complexity for brute force canConstruct algorith

m = target.length n= wordbank.length

time = o(n^m) space =o(m^2)

Time and space complexity of optimised canConstruct algorithm

m = target.length n = wordbank.length

time = n*m^2 space = o(m^2)

Time and space complexity of brute allConstruct algorithm

m = target.length n = wordbank.length

time = n*m^2 space = o(m^2)

Time and space complexity of optimised allConstruct algorithm

m= target.length n=wordBank.length

time = o(n^m)
space = o(m)

Tima and space complexity of fibonnacci algorithm using tabulation method

time = o(n) space = o(n)

Time and space complexity of GridTravella game using tabulation method

m:number of rows n:number of cols time = o(mn) space = o(mn)

Time and space complexity of canSum using tabulation method

m= targetSum n=numbers.length

time = o(mn) space = o(m)

Time and space complexity of howSum using tabulation method

m= targetSum numbers.length time = o(m^2*n) space = o(m^2)

Time and space complexity of bestSum using tabulation method

m = target n= numbers.length

time = O(m^2*n) space = O(m^2)

Time complexity of canConstruct using tabulation method

m= target n= wrodBank.length

time = O(m^2*n) space = O(m)

Time and space complecity of countConstruct using tabulation method

m= target n = wordBank.length

time = o(m^2*n) space = o(m)

Time and space complexity of allConstruct algorithm using tabulation method

m= target n=wordBank

time = o(n^m) space = o(n^m)

About

Learning Dynamic programming in advance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors