pokk / algorithm

My friend and I learned and programed the algorithm and design pattern. We're glad to share them to you.
0 stars 0 forks source link

Dynamic Programming - LCS #3

Closed weiancheng closed 8 years ago

weiancheng commented 8 years ago

Longest Common Subsequence

pokk commented 8 years ago

I have some problem in recursive programming. The problem as blow:

I wanna use switch case for recursive, there's not in python, so instead of switch case I try to use a data structure of dict. { 'u': xxx(i, j - 1), 'l': xxx(i - 1, j), 'ul': xxx(i - 1, j - 1) }.get(xxxxx[i][j]['direct']) to do it, it seems each of them will be ran again.