infix to prefix using stack algorithm