摘要: Dynamic ProgrammingThere is a nice introduction to the DP algorithm in thisWikipedia article. The idea is to maintain a running maximumsmaxand a curre... 阅读全文
posted @ 2015-08-16 15:55 jianchao-li 阅读(318) 评论(0) 推荐(0) 编辑
摘要: Well, if you have no idea of other methods, try to compue the result for all the numbers ranging from 1 to 20 and then you will see the regularity. Af... 阅读全文
posted @ 2015-08-16 13:36 jianchao-li 阅读(225) 评论(0) 推荐(0) 编辑
摘要: The basic idea is to start fromrootand add it to the currentpath, then we recursively visit itsleftandrightsubtrees if they exist; otherwise, we have ... 阅读全文
posted @ 2015-08-16 10:48 jianchao-li 阅读(336) 评论(0) 推荐(0) 编辑
摘要: The idea is to add the two binary numbers (represented as strings) from back to forth bit by bit and store the result in the longer string. After the ... 阅读全文
posted @ 2015-08-16 00:36 jianchao-li 阅读(198) 评论(0) 推荐(0) 编辑