Exemplo n.º 1
0
int main()
{
	
	SimpleStack<float> s;
	s.Push(12.4f);
	s.Push(3.14f);
	s.Print();
	cout<<s.IsEmpty()<<endl;
	cout<<s.Size()<<endl;
	cout<<s.Pop()<<endl;
	cout<<s.Pop()<<endl;
	cout<<s.Pop()<<endl;
	cout<<s.IsEmpty()<<endl;
	s.Push(0.618f);
	s.Print();
	cout<<s.Size()<<endl;
	return 0;
}
Exemplo n.º 2
0
    void moveSingle(SimpleStack<size_t> & from, SimpleStack<size_t> & to) {
        assert(!from.isEmpty());
        assert(from.peek() < to.peek());

        to.Push(from.Pop());

        if(print_states) {
            printState();
        }
    }