recursion-dynamic-programing

add_array.py - Given array of integers, recursive code to add sum of all previous numbers

fact.py - recursive and nonrecursive function to calculate factorial of n ^ 2

matrix_parse.py - total number of ways to move from top left cell to the bottom rigt

mult_table.py - print table of n as recirsive function

fib - fibonacci

min_cost - Find the min cost to reach 2,3 of a matrix

fill_plot - filling a plot of given size with a tile of given size

score_game - can score 3, 5, 10 . Given N, find total number of unique ways to reach N

max_sum_array - the max sum of sub array such that the elements are contiguos

edit_distance - Insert, Replace, Update

ways_top_bottom - Given matrix, find # of ways to move from top left to bottom right corner

ways_to_xy - Given matrix, find # of ways to move from top left to xy coordinates

ways_to_xy_block - Given a matrix, find no of ways to reach from 0,0 to x,y with some nodes blocked

min_chess_move - Find minimum # of moves required to reach from sr,sc to dr,dc

interleaved_strings - 2 string a = xyz and b = abcd is said to be interleaving c = xabycxd

interleaved_strings_print - given 2 strings, print all the interleavings of the string

interleaved_strings_different - if both strings different, find if interleaved with Time - O(n+m) and Space - O(1)

subset_sum - For X, if there exist a sum of subset = X

longest_common_sub - longest common subset given two strings

longest_palindromic.py - longest palindromic subsequence

partition_with_min_cut.py - partition string such that every subsring of the partition is a palindrome.

coin_change_min.py - find the min # of coins required to provide the change

mono_incr_max_len - return the length of the largest monotonically increasing subsequence

mono_incr_max_len_print - print longets monotonically incrementing subsequence of an array

itonic_sequence.py - if a seq is bitonic or not

bitonic_sequence_print.py - print the longest bitonic sequence

coin_change_tot.py - total number of ways we can make change of the amount using the coins of given denominations

rod_cut_max.py - how should the rod be cut to maximize the income

knapsack_unlimited.py - Knapsack, unlimited # of each items

knapsack_limited.py - Problem in Weights[n], int Values[n]

longest_palindromic.py - longest palindromic subsequence

largest_square_submatrix.py - the largest square subarray of true values

egg_floor_problem.py - min number of drops required to know form which floor the egg will break

egg_floor_problem_print.py - same a previous, we are printing the floors too

ugly_numbers.py - Given a number n, the task is to find n’th Ugly number.

longest_strip_color.py - Find the color with largest continuous string

partition_array_with_equal_sum.py - Paritioning/divide array such that left and right sums are same

public_transport.py - Given two cities can we reach from city1 to city2 using public transport

longest_palindromic_2.py - longest palindrome

dp_fib - finbonacci series

dp_gridTraveller - Travelling grids

dp_canSum - Target number and array of numbers

dp_howSum - target sum and array of numbers - how it is reached

dp_bestSum - target sum and array of numbers - the shortest path in which it can reach the sum

dp_canConstruct - Given a target string, can we construct the target string from the given set of wordbank

dp_countConstruct - Given a target string, Count the # of ways, we construct the target string from the given set of wordbank

dp_allconstruct - Given a target string, list all ways can we construct the target string from the given set of wordbank