1/17/2024 0 Comments Infix to postfix using stack java![]() ![]() ALSO, I HAVE USED BufferedReader FOR TAKING INPUT FROM THE USER. IF YOU ARE UNFAMILIAR WITH HashMap, PLEASE USE ANY OTHER DATA STRUCTURE LIKE AN array OR ArrayList, WHICHEVER YOU’RE FAMILIAR WITH. The final element at the top of the stack will be our postfix expression. Whenever an operator is found, we pop two operands from the stack and push a new operand. PLEASE NOTE THAT I HAVE USED HashMap FOR STORING THE PRIORITY OF THE OPERATOR. To convert a prefix to postfix expression, we will use a stack to hold the operands.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |