object-oriented software design patternthe template method pattern the template method pattern describes generic computation mechanism that can be specialized for particular application by redefining certain steps following the template method patternwe design an algorithm that implements generic euler tour traversal of binary tree this algorithmcalled templateeulertouris shown in code fragment code fragment an euler tour traversal of the subtree of binary tree rooted at node vfollowing the template method pattern when called on node vmethod templateeulertour calls several other auxiliary methods at different phases of the traversal namelyit creates local variable of type tourresultwhich is used to store intermediate results of the computation and has fields leftright and out calls auxiliary method visitleft( , , )which performs the computations associated with encountering the node on the left if has left childrecursively calls itself on the left child of and stores the returned value in left calls auxiliary method visitbelow(tvr)which performs the computations associated with encountering the node from below if has right childrecursively calls itself on the right child and stores the returned value in right