Friday, December 21, 2012

Online Unix /Shell Terminal

Please Click on below link to open.



I found this very useful. Start by clicking on open terminal
                  Online Unix Terminal

Saturday, November 24, 2012

Stacks



Stack uses the LIFO(last-in first-out) ordering. like a stack of dinner plates.


class Node
{
public:
    Node(Node *item)
    {
        value = item->value;
        next = item ->next;
    }
    int value;
    Node* next;
};

class Stack {
    Node* top;

public:

    int Pop() {
        if (top != 0) {
            Node* item = top;
            top = top->next;
            int val = item->value;
            delete item;
            return val;
        }
    }

    void Push(Node *item) {
        Node* t = new Node(item);
        t->next = top;
        top = t;
    }

    int peek() {
        return top->value;
    }
}