public TreeNode next() {
    		TreeNode rel=null;
    		while (c!=null) {
    			if (c.left!=null) {
    				TreeNode t=c.left;
    				while (t.right!=c&&t.right!=null)
    					t=t.right;
    				if (t.right==null) {
    					t.right=c;
    					c=c.left;
    				} else {
    					rel=c;
    					t.right=null;
    					c=c.right;
    				}			
    			} else {
    				rel=c;
    				c=c.right;
    			}
    		}
    		return rel;
    	}