Algorithm for data structure on k-order Fibonacci sequence