Skip to content

Commit 5b85975

Browse files
committed
Merge branch 'master' into beta
2 parents e6e1c67 + 476f439 commit 5b85975

File tree

123 files changed

+313
-326
lines changed

Some content is hidden

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

123 files changed

+313
-326
lines changed

.build/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Task Document -depends Build {
109109
git config --global credential.helper store
110110
Add-Content "$HOME\.git-credentials" "https://$($env:github_access_token):[email protected]`n"
111111
git config --global user.email $env:github_email
112-
git config --global user.name "buildbot121"
112+
git config --global user.name "buildbot171"
113113
git add . -A
114114
git commit -m "API documentation update by build server"
115115
git push origin master

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Note:
22

3-
Please don't take effort to create pull requests for new algorithms/data structures. This is just a curiosity driven personal hobby and [was originally not intented to be a library](https://github.com/justcoding121/Advanced-Algorithms/issues/2). Feel free fork and modify to fit your need if that's what you are looking for. You can however open issues/fix bugs with pull requests here, I would be happy to take a look when I get time.
3+
Please don't take effort to create pull requests for new algorithms/data structures. This is just a curiosity-driven personal hobby and [was originally not intended to be a library](https://github.com/justcoding121/Advanced-Algorithms/issues/2). Feel free fork and modify to fit your need if that's what you are looking for. You can, however, open issues/fix bugs with pull requests here, I would be happy to take a look when I get time
44

55
## Advanced Algorithms
66

@@ -77,7 +77,7 @@ Supports
7777
- [X] Fibonacci heap ([implementation](https://github.com/justcoding121/Advanced-Algorithms/blob/master/src/Advanced.Algorithms/DataStructures/Heap/FibonacciHeap.cs) | [tests](https://github.com/justcoding121/Advanced-Algorithms/blob/master/tests/Advanced.Algorithms.Tests/DataStructures/Heap/FibonacciHeap_Tests.cs))
7878
- [X] Pairing heap ([implementation](https://github.com/justcoding121/Advanced-Algorithms/blob/master/src/Advanced.Algorithms/DataStructures/Heap/PairingHeap.cs) | [tests](https://github.com/justcoding121/Advanced-Algorithms/blob/master/tests/Advanced.Algorithms.Tests/DataStructures/Heap/PairingHeap_Tests.cs))
7979

80-
Note: It is observed that among the implementations here in practice, with the exclusion of UpdateKey (decrement/increment) operation regular Binary Heap & d-ary Heap outperforms other in theory superiors. Likely because it don't have pointer juggling overhead and hey arrays are faster!
80+
Note: It is observed that among the implementations here, in practice, with the exclusion of UpdateKey (decrement/increment) operation, regular Binary Heap & d-ary Heap outperforms other in theory superiors. Likely because it doesn't have pointer juggling overhead and hey arrays are faster!
8181

8282
### Tree
8383

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test: on
4040
skip_tags: true
4141

4242
skip_commits:
43-
author: buildbot121
43+
author: buildbot171
4444
files:
4545
- docs/*
4646
- README.md
@@ -58,11 +58,11 @@ artifacts:
5858

5959
environment:
6060
github_access_token:
61-
secure: BGdKiI7FwHGkFt+/OmgZDkE1hzLqLrTxcc9c+joVqGyO4LvesHb1sR6hzisVwVPm
61+
secure: mZLeq0GTB9kb5b6+HnVpJB6hhiYMJIQ2+Zf/DwZ/LEIyxJaYB1nx36aGHXE9q1cN
6262
github_email:
63-
secure: wvYod3JLufbIBkavRXlCP724wJkhqR2RRuLLaPnqfps=
63+
secure: iBJZGqxyiHVNeYI0uIW+MdGd3I3pg8brJtETNRkKe/A=
6464
nuget_access_token:
65-
secure: ZbRmjOcp+TDllRV1wxqLZjdRV7hld388rXlWVJuGGiQleomP9Ku+Nsy3a75E7/9k
65+
secure: 65rklofkoUWJzPPja621kXlxrruHemmbREnIX7QgXK0cydW412yYMZJQsN42Js27
6666
deploy:
6767
- provider: GitHub
6868
auth_token: $(github_access_token)

src/Advanced.Algorithms/Binary/BaseConversion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Text;
33

44
namespace Advanced.Algorithms.Binary
5-
{
5+
{
66
/// <summary>
77
/// Base conversion implementation.
88
/// </summary>

src/Advanced.Algorithms/Compression/HuffmanCoding.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using System;
1+
using Advanced.Algorithms.DataStructures;
2+
using System;
23
using System.Collections.Generic;
3-
using Advanced.Algorithms.DataStructures;
44

55
namespace Advanced.Algorithms.Compression
66
{
@@ -53,7 +53,7 @@ public Dictionary<T, byte[]> Compress(T[] input)
5353
/// </summary>
5454
private void dfs(FrequencyWrap currentNode, List<byte> pathStack, Dictionary<T, byte[]> result)
5555
{
56-
if(currentNode.IsLeaf)
56+
if (currentNode.IsLeaf)
5757
{
5858
result.Add(currentNode.Item, pathStack.ToArray());
5959
return;
@@ -114,7 +114,7 @@ public FrequencyWrap(T item, int frequency)
114114

115115
public int CompareTo(object obj)
116116
{
117-
return Frequency.CompareTo(((FrequencyWrap) obj).Frequency);
117+
return Frequency.CompareTo(((FrequencyWrap)obj).Frequency);
118118
}
119119
}
120120

src/Advanced.Algorithms/DataStructures/Dictionary/Dictionary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Advanced.Algorithms.DataStructures.Foundation
99
/// </summary>
1010
/// <typeparam name="K">The key datatype.</typeparam>
1111
/// <typeparam name="V">The value datatype.</typeparam>
12-
public class Dictionary<K, V> : IEnumerable<KeyValuePair<K, V>>
12+
public class Dictionary<K, V> : IEnumerable<KeyValuePair<K, V>>
1313
{
1414
private readonly IDictionary<K, V> dictionary;
1515

src/Advanced.Algorithms/DataStructures/Dictionary/OpenAddressDictionary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Advanced.Algorithms.DataStructures.Foundation
66
{
7-
internal class OpenAddressDictionary<TK, TV> : IDictionary<TK, TV>
7+
internal class OpenAddressDictionary<TK, TV> : IDictionary<TK, TV>
88
{
99
private DictionaryKeyValuePair<TK, TV>[] hashArray;
1010
private int bucketSize => hashArray.Length;
@@ -368,7 +368,7 @@ internal DictionaryKeyValuePair(K key, V value)
368368
}
369369
}
370370

371-
internal class OpenAddressDictionaryEnumerator<TK, TV> : IEnumerator<KeyValuePair<TK, TV>>
371+
internal class OpenAddressDictionaryEnumerator<TK, TV> : IEnumerator<KeyValuePair<TK, TV>>
372372
{
373373
internal DictionaryKeyValuePair<TK, TV>[] HashArray;
374374

src/Advanced.Algorithms/DataStructures/Dictionary/SeparateChainingDictionary.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Advanced.Algorithms.DataStructures.Foundation
66
{
7-
internal class SeparateChainingDictionary<K, V> : IDictionary<K, V>
7+
internal class SeparateChainingDictionary<K, V> : IDictionary<K, V>
88
{
99
private const double tolerance = 0.1;
1010

@@ -15,7 +15,7 @@ internal class SeparateChainingDictionary<K, V> : IDictionary<K, V>
1515

1616
public int Count { get; private set; }
1717

18-
18+
1919
public SeparateChainingDictionary(int initialBucketSize = 3)
2020
{
2121
this.initialBucketSize = initialBucketSize;
@@ -301,7 +301,7 @@ public IEnumerator<KeyValuePair<K, V>> GetEnumerator()
301301

302302
}
303303

304-
internal class SeparateChainingDictionaryEnumerator<TK, TV> : IEnumerator<KeyValuePair<TK, TV>>
304+
internal class SeparateChainingDictionaryEnumerator<TK, TV> : IEnumerator<KeyValuePair<TK, TV>>
305305
{
306306
internal DoublyLinkedList<KeyValuePair<TK, TV>>[] HashList;
307307

src/Advanced.Algorithms/DataStructures/Graph/AdjacencyMatrix/WeightedGraph.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class WeightedGraph<T, TW> : IGraph<T>, IEnumerable<T> where TW : ICompar
2222
private Dictionary<T, WeightedGraphVertex<T, TW>> vertexObjects;
2323

2424
public int VerticesCount => usedSize;
25-
public bool IsWeightedGraph => true;
25+
public bool IsWeightedGraph => true;
2626

2727
public WeightedGraph()
2828
{
@@ -203,7 +203,7 @@ public bool HasEdge(T source, T dest)
203203
return false;
204204
}
205205

206-
public IEnumerable<KeyValuePair<T,TW>> Edges(T vertex)
206+
public IEnumerable<KeyValuePair<T, TW>> Edges(T vertex)
207207
{
208208
if (!vertexIndices.ContainsKey(vertex))
209209
{
@@ -214,7 +214,7 @@ public IEnumerable<KeyValuePair<T,TW>> Edges(T vertex)
214214

215215
for (int i = 0; i < maxSize; i++)
216216
{
217-
if (!matrix[i,index].Equals(default(TW)))
217+
if (!matrix[i, index].Equals(default(TW)))
218218
{
219219
yield return new KeyValuePair<T, TW>(reverseVertexIndices[i], matrix[i, index]);
220220
}
@@ -302,7 +302,7 @@ private void halfMatrixSize()
302302
{
303303
for (int j = i; j < maxSize; j++)
304304
{
305-
if (!matrix[i, j].Equals(default(TW)) && !matrix[j,i].Equals(default(TW))
305+
if (!matrix[i, j].Equals(default(TW)) && !matrix[j, i].Equals(default(TW))
306306
&& reverseVertexIndices.ContainsKey(i)
307307
&& reverseVertexIndices.ContainsKey(j))
308308
{
@@ -320,7 +320,7 @@ private void halfMatrixSize()
320320
reverseVertexIndices = newReverseIndices;
321321
}
322322

323-
public IEnumerable<IGraphVertex<T>> VerticesAsEnumberable => vertexObjects.Select(x=>x.Value);
323+
public IEnumerable<IGraphVertex<T>> VerticesAsEnumberable => vertexObjects.Select(x => x.Value);
324324

325325
IEnumerator IEnumerable.GetEnumerator()
326326
{

src/Advanced.Algorithms/DataStructures/Graph/IDiGraph.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Advanced.Algorithms.DataStructures.Graph
77
/// Directed graph.
88
/// </summary>
99
/// <typeparam name="T"></typeparam>
10-
public interface IDiGraph<T>
10+
public interface IDiGraph<T>
1111
{
1212
bool IsWeightedGraph { get; }
1313

@@ -19,7 +19,7 @@ public interface IDiGraph<T>
1919

2020
bool HasEdge(T source, T destination);
2121

22-
IDiGraph<T> Clone();
22+
IDiGraph<T> Clone();
2323
}
2424

2525
public interface IDiGraphVertex<T>

0 commit comments

Comments
 (0)