0 votes 0 votes Can we solve Towers of honoi with DP? If yes,then what will be time and space complexity? Algorithms recursion towers-of-hanoi programming time-complexity + – rahul sharma 5 asked Nov 26, 2017 rahul sharma 5 575 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply srestha commented Nov 26, 2017 reply Follow Share time complexityO(2^n) //number of disk moves space complexityO(1) //number of disks 0 votes 0 votes Surajit commented Nov 26, 2017 reply Follow Share Do this problem exhibit any properties of dynamic programming?I dont think so....there is no polynomial time algo for this (atleast till now) it will be in the order of exponential only.Even if you store every computation in any space it will be useless as you will compute only once and use once. 0 votes 0 votes balaeinstein commented Nov 26, 2017 reply Follow Share @srestha space complexity is not O(1) . Since we are using recursion , we have to consider the depth of the recursive stack which is O(n) I think . 0 votes 0 votes srestha commented Nov 26, 2017 reply Follow Share but if there are 3 element , we will go upto depth 3 in stack if 5 element, we go upto depth 5 Isnot it? 0 votes 0 votes Please log in or register to add a comment.