Skip to content

Commit

Permalink
Merge pull request #14 from justcoding121/master
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
justcoding121 authored May 1, 2018
2 parents 04737f0 + fad1989 commit 2f28835
Show file tree
Hide file tree
Showing 217 changed files with 9,253 additions and 9,097 deletions.
2 changes: 1 addition & 1 deletion .build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Task Document -depends Build {
git config --global user.email $env:github_email
git config --global user.name "buildbot121"
git add . -A
git commit -m "Maintanance commit by build server"
git commit -m "API documentation update by build server"
git push origin master

#move cd back to current location
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,7 @@ FakesAssemblies/
*.plg

# Visual Studio 6 workspace options file
*.opt
*.opt

# Docfx
docs/manifest.json
6 changes: 3 additions & 3 deletions Advanced.Algorithms.Tests/BitAlgorithms/GCD_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class GCD_Tests
[TestMethod]
public void GCD_Smoke_Test()
{
Assert.AreEqual(3, GCD.Find(-9, 3));
Assert.AreEqual(15, GCD.Find(45, 30));
Assert.AreEqual(3, Gcd.Find(-9, 3));
Assert.AreEqual(15, Gcd.Find(45, 30));

Assert.AreEqual(1, GCD.Find(3, 5));
Assert.AreEqual(1, Gcd.Find(3, 5));

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

namespace Advanced.Algorithms.Tests.BitAlgorithms
{
/// <summary>
/// Problem details below
/// http://www.geeksforgeeks.org/divisibility-9-using-bitwise-operators/
/// </summary>

[TestClass]
public class IsMultipleOfNine_Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

namespace Advanced.Algorithms.Tests.BitAlgorithms
{
/// <summary>
/// Problem details below
/// http://www.geeksforgeeks.org/write-an-efficient-method-to-check-if-a-number-is-multiple-of-3/
/// </summary>

[TestClass]
public class IsMultipleOfThree_Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

namespace Advanced.Algorithms.Tests.BitAlgorithms
{
/// <summary>
/// Problem details below
/// http://www.geeksforgeeks.org/smallest-power-of-2-greater-than-or-equal-to-n/
/// </summary>

[TestClass]
public class NextPowOfTwo_Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Dictionary_Tests
[TestMethod]
public void Dictionary_SeparateChaining_Test()
{
var Dictionary = new AsDictionary<int, int>(DictionaryType.SeparateChaining);
var Dictionary = new Dictionary<int, int>(DictionaryType.SeparateChaining);
int nodeCount = 1000 * 10;
//insert test

Expand Down Expand Up @@ -60,7 +60,7 @@ public void Dictionary_SeparateChaining_Test()
[TestMethod]
public void Dictionary_OpenAddressing_Test()
{
var Dictionary = new AsDictionary<int, int>(DictionaryType.OpenAddressing);
var Dictionary = new Dictionary<int, int>(DictionaryType.OpenAddressing);
int nodeCount = 1000 * 10;
//insert test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TreeDictionary_Tests
[TestMethod]
public void TreeDictionary_Test()
{
var Dictionary = new AsTreeDictionary<int, int>();
var Dictionary = new TreeDictionary<int, int>();

int nodeCount = 1000;
//insert test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class HashSet_Tests
[TestMethod]
public void HashSet_SeparateChaining_Test()
{
var HashSet = new AsHashSet<int>(HashSetType.SeparateChaining);
var HashSet = new HashSet<int>(HashSetType.SeparateChaining);
int nodeCount = 1000 * 10;
//insert test

Expand Down Expand Up @@ -60,7 +60,7 @@ public void HashSet_SeparateChaining_Test()
[TestMethod]
public void HashSet_OpenAddressing_Test()
{
var HashSet = new AsHashSet<int>(HashSetType.OpenAddressing);
var HashSet = new HashSet<int>(HashSetType.OpenAddressing);
int nodeCount = 1000 * 10;
//insert test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class AsD_aryMinTree_Tests
/// A tree test
/// </summary>
[TestMethod]
public void AsD_aryHeap_Test()
public void D_aryHeap_Test()
{
var rnd = new Random();
var initial = Enumerable.Range(0, 51).OrderBy(x => rnd.Next()).ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Queue_Tests
[TestMethod]
public void ArrayQueue_Test()
{
var Queue = new AsQueue<string>();
var Queue = new Queue<string>();

Queue.Enqueue("a");
Queue.Enqueue("b");
Expand Down Expand Up @@ -39,7 +39,7 @@ public void ArrayQueue_Test()
[TestMethod]
public void LinkedListQueue_Test()
{
var Queue = new AsQueue<string>(QueueType.LinkedList);
var Queue = new Queue<string>(QueueType.LinkedList);

Queue.Enqueue("a");
Queue.Enqueue("b");
Expand Down
4 changes: 2 additions & 2 deletions Advanced.Algorithms.Tests/DataStructures/Stack_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Stack_Tests
[TestMethod]
public void ArrayStack_Test()
{
var stack = new AsStack<string>();
var stack = new Stack<string>();

stack.Push("a");
stack.Push("b");
Expand All @@ -35,7 +35,7 @@ public void ArrayStack_Test()
[TestMethod]
public void LinkedListStack_Test()
{
var stack = new AsStack<string>(StackType.LinkedList);
var stack = new Stack<string>(StackType.LinkedList);

stack.Push("a");
stack.Push("b");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Advanced.Algorithms.Tests.DataStructures
{
[TestClass]
public class AVLTree_Tests
public class AvlTreeTests
{
/// <summary>
/// Smoke test
Expand Down
6 changes: 3 additions & 3 deletions Advanced.Algorithms.Tests/DataStructures/Tree/B+Tree_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class BPTree_Tests
public void BPTree_Smoke_Test()
{
//insert test
var tree = new BPTree<int>(3);
var tree = new BpTree<int>(3);

tree.Insert(5);
tree.Insert(3);
Expand Down Expand Up @@ -89,7 +89,7 @@ public void BPTree_AccuracyTest()
.ToList();

var order = 5;
var tree = new BPTree<int>(order);
var tree = new BpTree<int>(order);

for (int i = 0; i < nodeCount; i++)
{
Expand Down Expand Up @@ -165,7 +165,7 @@ public void BPTree_StressTest()
.OrderBy(x => rnd.Next())
.ToList();

var tree = new BPTree<int>(12);
var tree = new BpTree<int>(12);

for (int i = 0; i < nodeCount; i++)
{
Expand Down
26 changes: 13 additions & 13 deletions Advanced.Algorithms.Tests/DataStructures/Tree/BST_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,40 @@ public void BST_Test()
{
//insert test
var tree = new BST<int>();
Assert.AreEqual(tree.GetHeight(), -1);
Assert.AreEqual(tree.getHeight(), -1);

tree.Insert(11);
Assert.AreEqual(tree.GetHeight(), 0);
Assert.AreEqual(tree.getHeight(), 0);

tree.Insert(6);
Assert.AreEqual(tree.GetHeight(), 1);
Assert.AreEqual(tree.getHeight(), 1);

tree.Insert(8);
Assert.AreEqual(tree.GetHeight(), 2);
Assert.AreEqual(tree.getHeight(), 2);

tree.Insert(19);
Assert.AreEqual(tree.GetHeight(), 2);
Assert.AreEqual(tree.getHeight(), 2);

tree.Insert(4);
Assert.AreEqual(tree.GetHeight(), 2);
Assert.AreEqual(tree.getHeight(), 2);

tree.Insert(10);
Assert.AreEqual(tree.GetHeight(), 3);
Assert.AreEqual(tree.getHeight(), 3);

tree.Insert(5);
Assert.AreEqual(tree.GetHeight(), 3);
Assert.AreEqual(tree.getHeight(), 3);

tree.Insert(17);
Assert.AreEqual(tree.GetHeight(), 3);
Assert.AreEqual(tree.getHeight(), 3);

tree.Insert(43);
Assert.AreEqual(tree.GetHeight(), 3);
Assert.AreEqual(tree.getHeight(), 3);

tree.Insert(49);
Assert.AreEqual(tree.GetHeight(), 3);
Assert.AreEqual(tree.getHeight(), 3);

tree.Insert(31);
Assert.AreEqual(tree.GetHeight(), 3);
Assert.AreEqual(tree.getHeight(), 3);

//delete
tree.Delete(43);
Expand All @@ -65,7 +65,7 @@ public void BST_Test()
tree.Delete(49);
tree.Delete(31);

Assert.AreEqual(tree.GetHeight(), -1);
Assert.AreEqual(tree.getHeight(), -1);
Assert.AreEqual(tree.Count, 0);

tree.Insert(31);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class AsFenwickTreeTests
/// Smoke test
/// </summary>
[TestMethod]
public void AsFenwickTree_Sum_Smoke_Test()
public void FenwickTree_Sum_Smoke_Test()
{
var testArray = new int[] { 1, 3, 5, 7, 9, 11 };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class RangeTreeTests
/// Smoke test
/// </summary>
[TestMethod]
public void AsRangeTree1D_Smoke_Test()
public void RangeTree1D_Smoke_Test()
{
var tree = new DRangeTree<int>(1);

Expand Down Expand Up @@ -46,7 +46,7 @@ public void AsRangeTree1D_Smoke_Test()
}

[TestMethod]
public void AsRangeTree2D_Smoke_Test()
public void RangeTree2D_Smoke_Test()
{
var tree = new DRangeTree<int>(2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Advanced.Algorithms.Tests.DataStructures.Tree
{
[TestClass]
public class AsSegmentTreeTests
public class SegmentTreeTests
{
/// <summary>
/// Smoke test
/// </summary>
[TestMethod]
public void AsSegmentTree_Sum_Smoke_Test()
public void SegmentTree_Sum_Smoke_Test()
{
var testArray = new int[] { 1, 3, 5, 7, 9, 11 };

Expand Down
5 changes: 1 addition & 4 deletions Advanced.Algorithms.Tests/Geometry/ClosestPointPair_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

namespace Advanced.Algorithms.Tests.Geometry
{
/// <summary>
/// Problem details below
/// http://www.geeksforgeeks.org/closest-pair-of-points/
/// </summary>

[TestClass]
public class ClosestPointPair_Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

namespace Advanced.Algorithms.Tests.Geometry
{
/// <summary>
/// Problem details below
/// http://www.geeksforgeeks.org/how-to-check-if-a-given-point-lies-inside-a-polygon/
/// </summary>

[TestClass]
public class PointInsidePolygon_Tests
{
Expand Down
25 changes: 11 additions & 14 deletions Advanced.Algorithms.Tests/Geometry/RectangleIntersection_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

namespace Advanced.Algorithms.Tests.Geometry
{
/// <summary>
/// Problem details below
/// http://www.geeksforgeeks.org/find-two-rectangles-overlap/
/// </summary>

[TestClass]
public class RectangleIntersection_Tests
{
Expand All @@ -20,30 +17,30 @@ public void RectIntersection_Smoke_Test()
{
var result = RectangleIntersection.FindIntersection(new Rectangle()
{
leftTopCorner = new Point() { x = 0, y = 10 },
rightBottomCorner = new Point() { x = 10, y = 0 }
LeftTopCorner = new Point() { x = 0, y = 10 },
RightBottomCorner = new Point() { x = 10, y = 0 }
},
new Rectangle()
{
leftTopCorner = new Point() { x = 5, y = 5 },
rightBottomCorner = new Point() { x = 15, y = 0 }
LeftTopCorner = new Point() { x = 5, y = 5 },
RightBottomCorner = new Point() { x = 15, y = 0 }
});

Assert.AreEqual(result, new Rectangle()
{
leftTopCorner = new Point() { x = 5, y = 5 },
rightBottomCorner = new Point() { x = 10, y = 0 }
LeftTopCorner = new Point() { x = 5, y = 5 },
RightBottomCorner = new Point() { x = 10, y = 0 }
});

result = RectangleIntersection.FindIntersection(new Rectangle()
{
leftTopCorner = new Point() { x = 0, y = 10 },
rightBottomCorner = new Point() { x = 4, y = 0 }
LeftTopCorner = new Point() { x = 0, y = 10 },
RightBottomCorner = new Point() { x = 4, y = 0 }
},
new Rectangle()
{
leftTopCorner = new Point() { x = 5, y = 5 },
rightBottomCorner = new Point() { x = 15, y = 0 }
LeftTopCorner = new Point() { x = 5, y = 5 },
RightBottomCorner = new Point() { x = 15, y = 0 }
});

Assert.AreEqual(result, default(Rectangle));
Expand Down
5 changes: 1 addition & 4 deletions Advanced.Algorithms.Tests/Search/SearchAlmostSorted_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

namespace Advanced.Algorithms.Tests.Search
{
/// <summary>
/// Problem statement below
/// http://www.geeksforgeeks.org/search-almost-sorted-array/
/// </summary>

[TestClass]
public class SearchAlmostSorted_Tests
{
Expand Down
Loading

0 comments on commit 2f28835

Please sign in to comment.