Skip to content

Instantly share code, notes, and snippets.

View iruvingu's full-sized avatar
🏠
Working from home

Irving Flores iruvingu

🏠
Working from home
View GitHub Profile
@iruvingu
iruvingu / Infix to Postfix Java Code
Last active March 6, 2018 02:36
This code convert Infix notation to Postfix notation strings for a calculator. You can use whatever way to introduces the Strings but this time I introduce it manually. Hope this can work for you! //Unfortunately this doesn´t validate some facts of a calculator yet.
import java.util.Stack;
public class InfijoAPosfijo {
public static void main(String[] args) {
String myString = "2.3 + 1.2 * ( ( 3.2 + 12 ) - 12 )"; //You can put your entrance here
String[] expression = myString.split(" ");
String postfix = inf_posf(expression);
System.out.println(postfix);