Showing posts from September, 2013

Iterative(non-recursive) inorder traversal of binary tree in Java

In inorder traversal, left subtree is processed first followed by current node and then right subtree. In recursive version of inorder traversal stack(LIFO data structure) maintains references of left and right child. In iterative version of inorder …

Write to a file in Java - BufferedOutputStream and BufferedWriter

Topics covered 1. Write operation using FileOutputSrteam 2. Write operation using FileWriter 3. Write operation in append mode In Java Write operation can be performed using FileOutPutStream and FileWriter.  For writing streams of character, F…

Iterative(non-recursive) preorder traversal of binary tree in Java

In preorder traversal, each node is processed before either of its sub-tree(left and right). Once current node is processed, left sub-tree is processed and control return back to current node and then right sub-tree is processed. In recursive version …

Java puzzle - Set 3

Question 1:  What will be output of below sample program?  public class Multicast { /** * devinline.com * Puzzle reference : Java puzzlers */ public static void main ( String [] args ) { System . out . println (( byte ) - 1 )…

Load More
That is All