Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.xml.soap.Node;
- import java.util.Stack;
- public class Homework1 {
- public static void main(String[] args) {
- // Begin of arguments input sample
- if (args.length > 0) {
- String input = args[0];
- Stack inputstack = new Stack();
- Node root = null;
- for(int i=0;i<input.length();i++){
- char a = input.charAt(i);
- System.out.println(input.charAt(i));
- if(Character.isDigit(input.charAt(i))==true) {
- inputstack.push(new Node(a + ""));
- }else {
- int first,second,oparand;
- Node parentNode = new Node(a + "");
- parentNode.left = (Node) inputstack.pop();
- parentNode.right = (Node) inputstack.pop();
- inputstack.push(parentNode);
- }
- }
- }
- }
- public static int calculate(Node n){
- }
- public static Node infix(Node n){
- }
- public static String inorder(Node n){
- }
- public class tree{
- public class Node{
- char key;
- Node left;
- Node right;
- Node parent;
- }
- }
- }
- // End of arguments input sample
- // TODO: Implement your project here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement