Class Main {
public void dfs() {
		// DFS using Stack data structure
		Stack stack = new Stack();
		stack.push(this.rootNode);
		rootNode.visited=true; //mark pushed node as visited
		printNode(rootNode);
		while(!stack.isEmpty()) { //confirm there is no underflow
			Node node = (Node)s.peek();
			Node child = getUnvisitedChildNode(n);
			if(child != null) {
				child.visited = true;
				printNode(child);
				s.push(child);
			}
			else {
				s.pop();
			}
		}
		// Clear visited property of nodes
		clearNodes();
	}
}

	public void bfs()
	{
		// BFS using Queue data structure
		Queue queue = new LinkedList();
		queue.add(this.rootNode);
		printNode(this.rootNode);
		rootNode.visited = true;  //mark pushed node as visited
		while(!queue.isEmpty()) {  //confirm there is no underflow
			Node node = (Node)queue.remove();
			Node child=null;
			while((child=getUnvisitedChildNode(node))!=null) {
				child.visited=true;
				printNode(child);
				queue.add(child);
			}
		}
		// Clear visited property of nodes
		clearNodes();
	}

Class Node {
   Char data;
   Public Node(char c) {
      this.data=c;
}

@@ -1,12 +1,141 @@
+/**%0A * Implementation of BreadthFirst and DepthFirst Search Algorithms.%0A * %0A * @author Subham Mishra%0A * @since 19 feb 2016%0A * */%0A
 Class Main %7B

Update BFSDFS.java