package com.test;import java.util.Stack;public class PostOrderTraversal {static class Node {int data;Node left, right;Node(int item) {data = item;left = right;}}private void pfIterate(Node root) {Node prev = null;Stackstack = new Stack<>(); stack.push(root);while (!stack.isEmpty()) {root = stack.pop();if (root.left == null && root.right == null) {System.out.print(root.data + " ");prev = root;} else if (prev == root.left || prev == root.right) {System.out.print(root.data + " ");prev = root;} else {stack.push(root);if (root.right != null)stack.push(root.right);if (root.left != null)stack.push(root.left);}}}public static void main(String[] args) {// Let us create trees shown in above diagramNode root = new Node(1);root.left = new Node(2);root.right = new Node(3);root.left.left = new Node(4);root.left.right = new Node(5);root.right.left = new Node(6);root.right.right = new Node(7);new PostOrderTraversal().pfIterate(root);}}
Master-Detail Eclipse Forms I just finished working on the editor which uses the Master-Detail pattern of the eclipse forms. During which I faced several problems like: In my master block, when the size of table-viewer increased, the master block shows the scrollbar instead of table-viewer. Also, it made the length of the detail and master parts equal which made my editor unusable Detail part having scroll problems like the one mentioned above Setting the details part data-dynamically was yet another area where I faced a lot of problem In this blog, I will be giving a brief introduction about the master-detail pattern and will be addressing the problems mentioned above. The article by Dejan Glozic is really helpful and explains the basics of the eclipse forms. I’ll be explaining the stuff using FUSE Integration Designer(FID) which is an open source and available for download . And the screen-shots will be from the Messaging module of the FID using the example of JMS Messages . In
Comments
Post a Comment