From 5d5042d96e9176372ed566c29acc6266c7a844ad Mon Sep 17 00:00:00 2001 From: Taranpreet Singh <47025523+taran-1407@users.noreply.github.com> Date: Fri, 2 Oct 2020 02:10:13 +0530 Subject: [PATCH] Corrected Typo in variable name --- GraphBuilder/GraphBuilder.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/GraphBuilder/GraphBuilder.java b/GraphBuilder/GraphBuilder.java index a8d90e6..95a4be8 100644 --- a/GraphBuilder/GraphBuilder.java +++ b/GraphBuilder/GraphBuilder.java @@ -1,12 +1,12 @@ class GraphBuilder{ - public static int[][] makeGraph(int NumberOfNoes, int NumberOfEdges, int[] from, int[] to, boolean undirected){ - int[][] graph = new int[NumberOfNoes][]; - int[] outdegree = new int[NumberOfNoes]; + public static int[][] makeGraph(int NumberOfNodes, int NumberOfEdges, int[] from, int[] to, boolean undirected){ + int[][] graph = new int[NumberOfNodes][]; + int[] outdegree = new int[NumberOfNodes]; for(int i = 0; i< NumberOfEdges; i++){ outdegree[from[i]]++; if(undirected)outdegree[to[i]]++; } - for(int i = 0; i< NumberOfNoes; i++)graph[i] = new int[outdegree[i]]; + for(int i = 0; i< NumberOfNodes; i++)graph[i] = new int[outdegree[i]]; for(int i = 0; i< NumberOfEdges; i++){ graph[from[i]][--outdegree[from[i]]] = to[i]; if(undirected)graph[to[i]][--outdegree[to[i]]] = from[i]; @@ -14,14 +14,14 @@ public static int[][] makeGraph(int NumberOfNoes, int NumberOfEdges, int[] from, return graph; } - public static int[][][] makeGraphWithEdgeInfo(int NumberOfNoes, int NumberOfEdges, int[] from, int[] to, boolean undirected){ - int[][][] graph = new int[NumberOfNoes][][]; - int[] outdegree = new int[NumberOfNoes]; + public static int[][][] makeGraphWithEdgeInfo(int NumberOfNodes, int NumberOfEdges, int[] from, int[] to, boolean undirected){ + int[][][] graph = new int[NumberOfNodes][][]; + int[] outdegree = new int[NumberOfNodes]; for(int i = 0; i< NumberOfEdges; i++){ outdegree[from[i]]++; if(undirected)outdegree[to[i]]++; } - for(int i = 0; i< NumberOfNoes; i++)graph[i] = new int[outdegree[i]][]; + for(int i = 0; i< NumberOfNodes; i++)graph[i] = new int[outdegree[i]][]; for(int i = 0; i< NumberOfEdges; i++){ graph[from[i]][--outdegree[from[i]]] = new int[]{to[i], i, 0}; if(undirected)graph[to[i]][--outdegree[to[i]]] = new int[]{from[i], i, 1};