Skip to content

Commit 5a4429a

Browse files
committed
cleanup comments
1 parent 1ad9da8 commit 5a4429a

File tree

74 files changed

+672
-1032
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+672
-1032
lines changed

Advanced.Algorithms.Tests/DataStructures/Graph/AdjacencyList/DiGraph_Tests.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Advanced.Algorithms.DataStructures.Graph.AdjacencyList;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using System.Linq;
34

45
namespace Advanced.Algorithms.Tests.DataStructures.Graph.AdjacencyList
56
{
@@ -30,8 +31,11 @@ public void DiGraph_Smoke_Test()
3031
graph.AddEdge(4, 1);
3132
graph.AddEdge(3, 5);
3233

33-
Assert.AreEqual(2, graph.GetAllOutEdges(4).Count);
34-
Assert.AreEqual(2, graph.GetAllInEdges(5).Count);
34+
//IEnumerable test using linq
35+
Assert.AreEqual(graph.VerticesCount, graph.Count());
36+
37+
Assert.AreEqual(2, graph.OutEdges(4).Count());
38+
Assert.AreEqual(2, graph.InEdges(5).Count());
3539

3640
Assert.AreEqual(5, graph.VerticesCount);
3741

@@ -60,6 +64,9 @@ public void DiGraph_Smoke_Test()
6064
graph.RemoveVertex(5);
6165

6266
Assert.AreEqual(0, graph.VerticesCount);
67+
68+
//IEnumerable test using linq
69+
Assert.AreEqual(graph.VerticesCount, graph.Count());
6370
}
6471
}
6572
}

Advanced.Algorithms.Tests/DataStructures/Graph/AdjacencyList/Graph_Tests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Advanced.Algorithms.DataStructures.Graph.AdjacencyList;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using System.Linq;
34

45
namespace Advanced.Algorithms.Tests.DataStructures.Graph.AdjacencyList
56
{
@@ -27,7 +28,7 @@ public void Graph_Smoke_Test()
2728
graph.AddEdge(4, 1);
2829
graph.AddEdge(3, 5);
2930

30-
Assert.AreEqual(3, graph.GetAllEdges(4).Count);
31+
Assert.AreEqual(3, graph.Edges(4).Count());
3132

3233
Assert.AreEqual(5, graph.VerticesCount);
3334

Advanced.Algorithms.Tests/DataStructures/Graph/AdjacencyList/WeightedDiGraph_Tests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Advanced.Algorithms.DataStructures.Graph.AdjacencyList;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using System.Linq;
34

45
namespace Advanced.Algorithms.Tests.DataStructures.Graph.AdjacencyList
56
{
@@ -27,8 +28,8 @@ public void WeightedDiGraph_Smoke_Test()
2728
graph.AddEdge(4, 1, 6);
2829
graph.AddEdge(3, 5, 4);
2930

30-
Assert.AreEqual(2, graph.GetAllOutEdges(4).Count);
31-
Assert.AreEqual(2, graph.GetAllInEdges(5).Count);
31+
Assert.AreEqual(2, graph.OutEdges(4).Count());
32+
Assert.AreEqual(2, graph.InEdges(5).Count());
3233

3334
Assert.AreEqual(5, graph.VerticesCount);
3435

Advanced.Algorithms.Tests/DataStructures/Graph/AdjacencyMatrix/DiGraph_Tests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Advanced.Algorithms.DataStructures.Graph.AdjacencyMatrix;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using System.Linq;
34

45
namespace Advanced.Algorithms.Tests.DataStructures.Graph.AdjacencyMatrix
56
{
@@ -25,7 +26,7 @@ public void DiGraph_Smoke_Test()
2526
Assert.IsFalse(graph.HasEdge(2, 1));
2627

2728
graph.AddEdge(3, 2);
28-
Assert.AreEqual(2, graph.GetAllInEdges(2).Count);
29+
Assert.AreEqual(2, graph.InEdges(2).Count());
2930
graph.RemoveEdge(3, 2);
3031

3132
graph.AddEdge(2, 3);
@@ -34,7 +35,7 @@ public void DiGraph_Smoke_Test()
3435
graph.AddEdge(4, 1);
3536
graph.AddEdge(3, 5);
3637

37-
Assert.AreEqual(2, graph.GetAllOutEdges(4).Count);
38+
Assert.AreEqual(2, graph.OutEdges(4).Count());
3839

3940
Assert.AreEqual(5, graph.VerticesCount);
4041

Advanced.Algorithms.Tests/DataStructures/Graph/AdjacencyMatrix/Graph_Tests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Advanced.Algorithms.DataStructures.Graph.AdjacencyMatrix;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using System.Linq;
34

45
namespace Advanced.Algorithms.Tests.DataStructures.Graph.AdjacencyMatrix
56
{
@@ -27,7 +28,7 @@ public void Graph_Smoke_Test()
2728

2829
graph.AddEdge(2, 3);
2930

30-
Assert.AreEqual(2, graph.GetAllEdges(2).Count);
31+
Assert.AreEqual(2, graph.Edges(2).Count());
3132

3233
graph.AddEdge(3, 4);
3334
graph.AddEdge(4, 5);

Advanced.Algorithms.Tests/DataStructures/Graph/AdjacencyMatrix/WeightedDiGraph_Tests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Advanced.Algorithms.DataStructures.Graph.AdjacencyMatrix;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using System.Linq;
34

45
namespace Advanced.Algorithms.Tests.DataStructures.Graph.AdjacencyMatrix
56
{
@@ -27,8 +28,8 @@ public void WeightedDiGraph_Smoke_Test()
2728
graph.AddEdge(4, 1, 6);
2829
graph.AddEdge(3, 5, 4);
2930

30-
Assert.AreEqual(2, graph.GetAllOutEdges(4).Count);
31-
Assert.AreEqual(2, graph.GetAllInEdges(5).Count);
31+
Assert.AreEqual(2, graph.OutEdges(4).Count());
32+
Assert.AreEqual(2, graph.InEdges(5).Count());
3233

3334
Assert.AreEqual(5, graph.VerticesCount);
3435

Advanced.Algorithms.Tests/DataStructures/Graph/AdjacencyMatrix/WeightedGraph_Tests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Advanced.Algorithms.DataStructures.Graph.AdjacencyMatrix;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using System.Linq;
34

45
namespace Advanced.Algorithms.Tests.DataStructures.Graph.AdjacencyMatrix
56
{
@@ -27,7 +28,7 @@ public void WeightedGraph_Smoke_Test()
2728
graph.AddEdge(4, 1, 1);
2829
graph.AddEdge(3, 5, 6);
2930

30-
Assert.AreEqual(2, graph.GetAllEdges(2).Count);
31+
Assert.AreEqual(2, graph.Edges(2).Count());
3132

3233
Assert.AreEqual(5, graph.VerticesCount);
3334

Advanced.Algorithms.Tests/DataStructures/Set/BloomFilter_Tests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public void BloomFilter_Smoke_Test()
1717

1818
Assert.IsTrue(filter.KeyExists("cat"));
1919
Assert.IsFalse(filter.KeyExists("bat"));
20-
21-
2220
}
2321
}
2422
}

Advanced.Algorithms/Binary/GCD.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
namespace Advanced.Algorithms.Binary
22
{
3-
//GCD without division or mod operators
4-
//GCD by substraction
3+
/// <summary>
4+
/// GCD without division or mod operators but using substraction.
5+
/// </summary>
56
public class Gcd
67
{
78
public static int Find(int a, int b)

Advanced.Algorithms/Combinatorics/Combination.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,5 @@ private static void recurse<T>(List<T> input, int r, bool withRepetition,
4040
}
4141
}
4242

43-
4443
}
4544
}

0 commit comments

Comments
 (0)