sec stacks example the toh function shown in figure makes two recursive callsone to move rings off the bottom ringand another to move these rings back to the goal pole we can eliminate the recursion by using stack to store representation of the three operations that toh must performtwo recursive calls and move operation to do sowe must first come up with representation of the various operationsimplemented as class whose objects will be stored on the stack here is such class class tohobj public operation oppublic int numpublic pole startgoaltemptohobj(operation oint npole spole gpole top onum nstart sgoal gtemp ttohobj(operation opole spole gop ostart sgoal /move class tohobj stores five valuesan operation field (indicating either move or new toh operation)the number of ringsand the three poles note that the move operation actually needs only to store information about two poles thusthere are two constructorsone to store the state when imitating recursive calland one to store the state for move operation the non-recursive version of toh can now be presented