diff --git a/.DS_Store b/.DS_Store index f28585d7..08cfaf75 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/DecimalToOctal.java b/Conversions/DecimalToOctal.java similarity index 100% rename from DecimalToOctal.java rename to Conversions/DecimalToOctal.java diff --git a/CountChar.java b/Misc/CountChar.java similarity index 100% rename from CountChar.java rename to Misc/CountChar.java diff --git a/Dijkshtra.java b/Misc/Dijkshtra.java similarity index 100% rename from Dijkshtra.java rename to Misc/Dijkshtra.java diff --git a/Factorial.java b/Misc/Factorial.java similarity index 100% rename from Factorial.java rename to Misc/Factorial.java diff --git a/FindingPrimes.java b/Misc/FindingPrimes.java similarity index 100% rename from FindingPrimes.java rename to Misc/FindingPrimes.java diff --git a/ReverseString.java b/Misc/ReverseString.java similarity index 100% rename from ReverseString.java rename to Misc/ReverseString.java diff --git a/countwords.java b/Misc/countwords.java similarity index 100% rename from countwords.java rename to Misc/countwords.java diff --git a/ft.java b/Misc/ft.java similarity index 100% rename from ft.java rename to Misc/ft.java diff --git a/krishnamurthy.java b/Misc/krishnamurthy.java similarity index 100% rename from krishnamurthy.java rename to Misc/krishnamurthy.java diff --git a/removeDuplicateFromString.java b/Misc/removeDuplicateFromString.java similarity index 100% rename from removeDuplicateFromString.java rename to Misc/removeDuplicateFromString.java diff --git a/data_structures/Graphs.java b/data_structures/Graphs/Graphs.java similarity index 100% rename from data_structures/Graphs.java rename to data_structures/Graphs/Graphs.java diff --git a/bfs.java b/data_structures/Graphs/bfs.java similarity index 85% rename from bfs.java rename to data_structures/Graphs/bfs.java index 90ff4eca..4f3bd62d 100644 --- a/bfs.java +++ b/data_structures/Graphs/bfs.java @@ -2,27 +2,27 @@ import java.util.*; /** * Implementation of a Breadth First Search - * + * * @author Unknown * */ public class bfs{ - + /** - * The BFS implemented in code to use. - * - * @param a Structure to perform the search on + * The BFS implemented in code to use. + * + * @param a Structure to perform the search on a graph, adjacency matrix etc. * @param vertices The vertices to use * @param source The Source */ public static void bfsImplement(byte [][] a,int vertices,int source){ //passing adjacency matrix and no of vertices byte []b=new byte[vertices]; //flag container containing status of each vertices Arrays.fill(b,(byte)-1); //status initialization - /* code status + /* code status -1 = ready 0 = waiting 1 = processed */ - + Stack st = new Stack(vertices); //operational stack st.push(source); //assigning source while(!st.isEmpty()){ @@ -30,18 +30,18 @@ public class bfs{ System.out.println(st.peek()); int pop=st.peek(); b[pop]=(byte)1; //assigning processed status - st.pop(); //removing head of the queue + st.pop(); //removing head of the queue for(int i=0;i