Tail recursion in Data Structure