I found this code :

void iterativePreorder(node *root)
{
     // Base Case
    if (root == NULL)
       return;

    // Create an empty stack and push root to it
    stack&lt;node *&gt; nodeStack;
    nodeStack.push(root);

    /* Pop all items one by one. Do following for every popped item
       a) print it
       b) push its right child
       c) push its left child
    Note that right child is pushed first so that left is processed first */
    while (nodeStack.empty() == false)
    {
        // Pop the top item from stack and print it
        struct node *node = nodeStack.top();
        printf ("%d ", node-&gt;data);
        nodeStack.pop();

        // Push right and left children of the popped node to stack
        if (node-&gt;right)
            nodeStack.push(node-&gt;right);
        if (node-&gt;left)
            nodeStack.push(node-&gt;left);
    }
}


here:
http://www.geeksforgeeks.org/iterative-preorder-traversal/

I am aware that this code is in C++ but you can create a simple stack set of functions in C to bypass that problem.

If needed this link can help with that too :

http://groups.csail.mit.edu/graphics/classes/6.837/F04/cpp_notes/stack1.html

Binary tree traversal without using recursion
I'm using latex templates which is producing a particular kind of math font, shown below. 



How can I change it to produce something like following? I'm particularly interested in changing the math font. 



Is there any specific package that I should exclude? unfortunately there are a couple of style and cls files and I'm not sure what is responsible for this change in font.
