Skip to content

Commit 8252300

Browse files
Merge pull request #16 from justcoding121/master
Beta
2 parents 2f28835 + 61e2f74 commit 8252300

File tree

490 files changed

+20661
-21546
lines changed

Some content is hidden

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

490 files changed

+20661
-21546
lines changed

Advanced.Algorithms.Tests/Advanced.Algorithms.Tests.csproj

+47-56
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,15 @@
5656
</Otherwise>
5757
</Choose>
5858
<ItemGroup>
59-
<Compile Include="BitAlgorithms\BaseConversion_Tests.cs" />
60-
<Compile Include="BitAlgorithms\BitHacks_Tests.cs" />
61-
<Compile Include="BitAlgorithms\CalcLogarithm_Tests.cs" />
62-
<Compile Include="BitAlgorithms\DivisionModulus_Tests.cs" />
63-
<Compile Include="BitAlgorithms\GCD_Tests.cs" />
64-
<Compile Include="BitAlgorithms\IntToBinary_Tests.cs" />
65-
<Compile Include="BitAlgorithms\IsMultipleOfNine_Tests.cs" />
66-
<Compile Include="BitAlgorithms\IsMultipleOfThree_Tests.cs" />
67-
<Compile Include="BitAlgorithms\NextPowOfTwo_Tests.cs" />
68-
<Compile Include="BitAlgorithms\ToggleCase_Tests.cs" />
59+
<Compile Include="Binary\BaseConversion_Tests.cs" />
60+
<Compile Include="Binary\Logarithm_Tests.cs" />
61+
<Compile Include="Binary\GCD_Tests.cs" />
6962
<Compile Include="Combinatorics\Subset_Tests.cs" />
7063
<Compile Include="Combinatorics\Combination_Tests.cs" />
7164
<Compile Include="Combinatorics\Permutation_Tests.cs" />
7265
<Compile Include="Compression\HuffmanCoding_Tests.cs" />
7366
<Compile Include="DataStructures\Dictionary\Dictionary_Tests.cs" />
74-
<Compile Include="DataStructures\Dictionary\TreeDictionary_Tests.cs" />
67+
<Compile Include="DataStructures\Dictionary\SortedDictionary_Tests.cs" />
7568
<Compile Include="DataStructures\Graph\AdjacencyMatrix\DiGraph_Tests.cs" />
7669
<Compile Include="DataStructures\Graph\AdjacencyMatrix\Graph_Tests.cs" />
7770
<Compile Include="DataStructures\Graph\AdjacencyMatrix\WeightedDiGraph_Tests.cs" />
@@ -81,7 +74,7 @@
8174
<Compile Include="DataStructures\Graph\AdjacencyList\WeightedDiGraph_Tests.cs" />
8275
<Compile Include="DataStructures\Graph\AdjacencyList\WeightedGraph_Tests.cs" />
8376
<Compile Include="DataStructures\HashSet\HashSet_Tests.cs" />
84-
<Compile Include="DataStructures\HashSet\TreeHashSet_Tests.cs" />
77+
<Compile Include="DataStructures\HashSet\SortedHashSet_Tests.cs" />
8578
<Compile Include="DataStructures\Heap\Max\BinomialMaxHeap_Tests.cs" />
8679
<Compile Include="DataStructures\Heap\Max\BMaxHeap_Tests.cs" />
8780
<Compile Include="DataStructures\Heap\Max\D-aryMaxHeap_Tests.cs" />
@@ -98,76 +91,75 @@
9891
<Compile Include="DataStructures\Lists\ArrayList_Tests.cs" />
9992
<Compile Include="DataStructures\Lists\SkipList_Tests.cs" />
10093
<Compile Include="DataStructures\Queues\PriorityQueue\MaxPriorityQueue_Tests.cs" />
101-
<Compile Include="DistributedSystems\CircularQueue_Tests.cs" />
94+
<Compile Include="DataStructures\Tree\AVLTree_Tests.cs" />
95+
<Compile Include="DataStructures\Tree\BST_Tests.cs" />
96+
<Compile Include="DataStructures\Tree\KdTree_Tests.cs" />
97+
<Compile Include="DataStructures\Tree\RangeTreeTests.cs" />
98+
<Compile Include="DataStructures\Tree\RTree_Tests.cs" />
99+
<Compile Include="DataStructures\Tree\SplayTree_Tests.cs" />
100+
<Compile Include="DataStructures\Tree\TreapTree_Tests.cs" />
101+
<Compile Include="Distributed\CircularQueue_Tests.cs" />
102102
<Compile Include="DataStructures\Queues\Queue_Tests.cs" />
103103
<Compile Include="DataStructures\Set\BloomFilter_Tests.cs" />
104104
<Compile Include="DataStructures\Set\DisJointSet_Tests.cs" />
105105
<Compile Include="DataStructures\Set\SparseSet_Tests.cs" />
106106
<Compile Include="DataStructures\Stack_Tests.cs" />
107-
<Compile Include="DataStructures\Tree\ExpressionTree_Tests.cs" />
108-
<Compile Include="DataStructures\Tree\RangeTreeTests.cs" />
109107
<Compile Include="DataStructures\Tree\TernarySearchTree_Tests.cs" />
110108
<Compile Include="DataStructures\Tree\Trie_Tests.cs" />
111-
<Compile Include="DataStructures\Tree\AVLTree_Tests.cs" />
112109
<Compile Include="DataStructures\Tree\B+Tree_Tests.cs" />
113110
<Compile Include="DataStructures\Tree\BTree_Tests.cs" />
114111
<Compile Include="DataStructures\Tree\FenwickTree_Tests.cs" />
115112
<Compile Include="DataStructures\Tree\IntervalTree_Tests.cs" />
116-
<Compile Include="DataStructures\Tree\KdTree_Tests.cs" />
117113
<Compile Include="DataStructures\Tree\SegmentTree_Tests.cs" />
118114
<Compile Include="DataStructures\Tree\SuffixTree_Tests.cs" />
119115
<Compile Include="DataStructures\Tree\TestHelpers\BTreeTester.cs" />
120-
<Compile Include="DataStructures\Tree\TreapTree_Tests.cs" />
121-
<Compile Include="DataStructures\Tree\SplayTree_Tests.cs" />
122-
<Compile Include="DataStructures\Tree\BST_Tests.cs" />
123116
<Compile Include="DataStructures\Queues\PriorityQueue\MinPriorityQueue_Tests.cs" />
124117
<Compile Include="DataStructures\Tree\RedBlackTree_Tests.cs" />
125118
<Compile Include="DataStructures\Tree\TestHelpers\BinarySearchTreeTester.cs" />
126119
<Compile Include="DataStructures\Tree\Tree_Tests.cs" />
127120
<Compile Include="DataStructures\Tree\BinaryTree_Tests.cs" />
128-
<Compile Include="DistributedSystems\ConsistentHash_Tests.cs" />
129-
<Compile Include="DistributedSystems\LRUCache_Tests.cs" />
121+
<Compile Include="Distributed\ConsistentHash_Tests.cs" />
122+
<Compile Include="Distributed\LRUCache_Tests.cs" />
123+
<Compile Include="Geometry\BentleyOttmann_Tests.cs" />
130124
<Compile Include="Geometry\PointRotation_Tests.cs" />
131-
<Compile Include="GraphAlgorithms\ShortestPath\TravellingSalesman_Tests.cs" />
132-
<Compile Include="Miscellaneous\MatrixMultiplication_Tests.cs" />
125+
<Compile Include="Graph\ShortestPath\TravellingSalesman_Tests.cs" />
133126
<Compile Include="Geometry\ClosestPointPair_Tests.cs" />
134127
<Compile Include="Geometry\ConvexHull_Tests.cs" />
135128
<Compile Include="Geometry\PointInsidePolygon_Tests.cs" />
136129
<Compile Include="Geometry\LineIntersection_Tests.cs" />
137130
<Compile Include="Geometry\RectangleIntersection_Tests.cs" />
138-
<Compile Include="GraphAlgorithms\ArticulationPoints\TarjansArticulation_Tests.cs" />
139-
<Compile Include="GraphAlgorithms\Bridge\TarjansBridge_Tests.cs" />
140-
<Compile Include="GraphAlgorithms\Coloring\MColoring_Tests.cs" />
141-
<Compile Include="GraphAlgorithms\Connectivity\TarjansBiConnected_Tests.cs" />
142-
<Compile Include="GraphAlgorithms\Connectivity\KosarajuStronglyConnected_Tests.cs" />
143-
<Compile Include="GraphAlgorithms\Connectivity\TarjansStronglyConnected_Tests.cs" />
144-
<Compile Include="GraphAlgorithms\Cover\MinVertexCover.cs" />
145-
<Compile Include="GraphAlgorithms\Cut\MinCut_Tests.cs" />
146-
<Compile Include="GraphAlgorithms\Cycle\CycleDetection_Tests.cs" />
147-
<Compile Include="GraphAlgorithms\Flow\EdmondsKarp_Tests.cs" />
148-
<Compile Include="GraphAlgorithms\Flow\FordFulkerson_Tests.cs" />
149-
<Compile Include="GraphAlgorithms\Flow\PushRelabel_Tests.cs" />
150-
<Compile Include="GraphAlgorithms\Matching\HopcroftKarp_Tests.cs" />
151-
<Compile Include="GraphAlgorithms\Matching\BiPartiteMatching_Tests.cs" />
152-
<Compile Include="GraphAlgorithms\MinimumSpanningTree\Prims_Test.cs" />
153-
<Compile Include="GraphAlgorithms\MinimumSpanningTree\Kruskals_Test.cs" />
154-
<Compile Include="GraphAlgorithms\Search\BiDirectional_Tests.cs" />
155-
<Compile Include="GraphAlgorithms\Search\BreadthFirst_Tests.cs" />
156-
<Compile Include="GraphAlgorithms\Search\DepthFirst_Tests.cs" />
157-
<Compile Include="GraphAlgorithms\ShortestPath\BellmanFord_Tests.cs" />
158-
<Compile Include="GraphAlgorithms\ShortestPath\Dijikstras_Tests.cs" />
159-
<Compile Include="GraphAlgorithms\ShortestPath\FloydWarshall_Tests.cs" />
160-
<Compile Include="GraphAlgorithms\ShortestPath\Johnson_Tests.cs" />
161-
<Compile Include="GraphAlgorithms\TopologicalSort\DepthFirstTopSort_Tests.cs" />
162-
<Compile Include="GraphAlgorithms\TopologicalSort\KahnTopSort_Tests.cs" />
163-
<Compile Include="NumericalMethods\Exponentiation_Tests.cs" />
164-
<Compile Include="NumericalMethods\KthSmallest_Tests.cs" />
165-
<Compile Include="NumericalMethods\MedianStream_Tests.cs" />
166-
<Compile Include="NumericalMethods\Primality_Tests.cs" />
167-
<Compile Include="NumericalMethods\PrimeGenerator_Tests.cs" />
131+
<Compile Include="Graph\ArticulationPoints\TarjansArticulation_Tests.cs" />
132+
<Compile Include="Graph\Bridge\TarjansBridge_Tests.cs" />
133+
<Compile Include="Graph\Coloring\MColoring_Tests.cs" />
134+
<Compile Include="Graph\Connectivity\TarjansBiConnected_Tests.cs" />
135+
<Compile Include="Graph\Connectivity\KosarajuStronglyConnected_Tests.cs" />
136+
<Compile Include="Graph\Connectivity\TarjansStronglyConnected_Tests.cs" />
137+
<Compile Include="Graph\Cover\MinVertexCover.cs" />
138+
<Compile Include="Graph\Cut\MinCut_Tests.cs" />
139+
<Compile Include="Graph\Cycle\CycleDetection_Tests.cs" />
140+
<Compile Include="Graph\Flow\EdmondsKarp_Tests.cs" />
141+
<Compile Include="Graph\Flow\FordFulkerson_Tests.cs" />
142+
<Compile Include="Graph\Flow\PushRelabel_Tests.cs" />
143+
<Compile Include="Graph\Matching\HopcroftKarp_Tests.cs" />
144+
<Compile Include="Graph\Matching\BiPartiteMatching_Tests.cs" />
145+
<Compile Include="Graph\MinimumSpanningTree\Prims_Test.cs" />
146+
<Compile Include="Graph\MinimumSpanningTree\Kruskals_Test.cs" />
147+
<Compile Include="Graph\Search\BiDirectional_Tests.cs" />
148+
<Compile Include="Graph\Search\BreadthFirst_Tests.cs" />
149+
<Compile Include="Graph\Search\DepthFirst_Tests.cs" />
150+
<Compile Include="Graph\ShortestPath\BellmanFord_Tests.cs" />
151+
<Compile Include="Graph\ShortestPath\Dijikstras_Tests.cs" />
152+
<Compile Include="Graph\ShortestPath\FloydWarshall_Tests.cs" />
153+
<Compile Include="Graph\ShortestPath\Johnson_Tests.cs" />
154+
<Compile Include="Graph\Sort\DepthFirstTopSort_Tests.cs" />
155+
<Compile Include="Graph\Sort\KahnTopSort_Tests.cs" />
156+
<Compile Include="Numerical\Exponentiation_Tests.cs" />
157+
<Compile Include="Numerical\Primality_Tests.cs" />
158+
<Compile Include="Numerical\PrimeGenerator_Tests.cs" />
168159
<Compile Include="Properties\AssemblyInfo.cs" />
169160
<Compile Include="Search\BinarySearch_Tests.cs" />
170-
<Compile Include="Search\SearchAlmostSorted_Tests.cs" />
161+
<Compile Include="Search\BoyerMoore_Tests.cs" />
162+
<Compile Include="Search\QuickSelect_Tests.cs" />
171163
<Compile Include="Sorting\BubbleSort_Tests.cs" />
172164
<Compile Include="Sorting\BucketSort_Tests.cs" />
173165
<Compile Include="Sorting\CountingSort_Tests.cs" />
@@ -178,7 +170,6 @@
178170
<Compile Include="Sorting\RadixSort_Tests.cs" />
179171
<Compile Include="Sorting\SelectionSort_Tests.cs" />
180172
<Compile Include="Sorting\ShellSort_Tests.cs" />
181-
<Compile Include="Sorting\SortAlmostSorted_Tests.cs" />
182173
<Compile Include="Sorting\TreeSort_Tests.cs" />
183174
<Compile Include="String\Manachers_Tests.cs" />
184175
<Compile Include="String\Search\RabinKarp_Tests.cs" />

Advanced.Algorithms.Tests/BitAlgorithms/BaseConversion_Tests.cs renamed to Advanced.Algorithms.Tests/Binary/BaseConversion_Tests.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
using Advanced.Algorithms.BitAlgorithms;
1+
using Advanced.Algorithms.Binary;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
83

9-
namespace Advanced.Algorithms.Tests.BitAlgorithms
4+
namespace Advanced.Algorithms.Tests.Binary
105
{
116
[TestClass]
127
public class BaseConversion_Tests

Advanced.Algorithms.Tests/BitAlgorithms/GCD_Tests.cs renamed to Advanced.Algorithms.Tests/Binary/GCD_Tests.cs

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
using Advanced.Algorithms.BitAlgorithms;
2-
using Microsoft.VisualStudio.TestTools.UnitTesting;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using Advanced.Algorithms.Binary;
83

9-
namespace Advanced.Algorithms.Tests.BitAlgorithms
4+
namespace Advanced.Algorithms.Tests.Binary
105
{
116
[TestClass]
127
public class GCD_Tests
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Advanced.Algorithms.Binary;
2+
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
4+
5+
namespace Advanced.Algorithms.Tests.Binary
6+
{
7+
[TestClass]
8+
public class Logarithm_Tests
9+
{
10+
[TestMethod]
11+
public void Logarithm_Smoke_Test()
12+
{
13+
Assert.AreEqual(3, Logarithm.CalcBase2LogFloor(9));
14+
Assert.AreEqual(3, Logarithm.CalcBase2LogFloor(8));
15+
Assert.AreEqual(5, Logarithm.CalcBase2LogFloor(32));
16+
17+
Assert.AreEqual(2, Logarithm.CalcBase10LogFloor(102));
18+
Assert.AreEqual(3, Logarithm.CalcBase10LogFloor(1000));
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)