pub fn fibonacci_dynamic_tail_recursive(n: i32, a: &mut i32, b: &mut i32) -> i32 {

    if n <= 1 {
        return *b;
    } 

    let res = *a + *b;
    *a = *b;
    *b = res;
    
    fibonacci_dynamic_tail_recursive(n-1, a, b)
}
/// recursive fibonacci algorithm with dynamic programming
/// and tail recursive function
recursive fibonacci algorithm with dynamic programming
and tail recursive function
recursive fibonacci algorithm with dynamic programming and tail recursive function
pub fn fibonacci_dynamic_tail_recursive(n: i32, a: &mut i32, b: &mut i32) -> i32 {
    if n <= 1 {
        return *b;
    } 
    let res = *a + *b;
    *a = *b;
    *b = res;
    fibonacci_dynamic_tail_recursive(n-1, a, b)
}
pub fn fibonacci_dynamic_tail_recursive ( n : i32 , a : & mut i32 , b : & mut i32 ) -> i32 { if n <= 1 { return * b ; } let res = * a + * b ; * a = * b ; * b = res ; fibonacci_dynamic_tail_recursive ( n - 1 , a , b ) }
recursive fibonacci algorithm with dynamic programming
and tail recursive function
recursive fibonacci algorithm with dynamic programming and tail recursive function
n
i32
a
&mut i32
b
&mut i32
n
i32
a
&mut i32
b
&mut i32