Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

BFS in graph

Language: Layout:
+ ] Show input
Compilation time: 0.72 sec, absolute running time: 0.23 sec, cpu time: 0.15 sec, memory peak: 35 Mb, absolute service time: 1,16 sec  
edit mode |  history  | discussion
Error(s), warning(s):
357522491/source.java:17: warning: [rawtypes] found raw type: LinkedList
		adj = new LinkedList[v];
		          ^
  missing type arguments for generic class LinkedList<E>
  where E is a type-variable:
    E extends Object declared in class LinkedList
357522491/source.java:17: warning: [unchecked] unchecked conversion
		adj = new LinkedList[v];
		      ^
  required: LinkedList<Integer>[]
  found:    LinkedList[]
357522491/source.java:19: warning: [rawtypes] found raw type: LinkedList
			adj[i] = new LinkedList();
			             ^
  missing type arguments for generic class LinkedList<E>
  where E is a type-variable:
    E extends Object declared in class LinkedList
357522491/source.java:19: warning: [unchecked] unchecked conversion
			adj[i] = new LinkedList();
			         ^
  required: LinkedList<Integer>
  found:    LinkedList
4 warnings


Following is Breadth First Traversal (starting from vertex 2)
2 0 3 1 

    
                
λ
.NET NoSQL database for rapid development