Skip to content

Commit 81e7003

Browse files
committed
improve readability
1 parent 6cbe9e9 commit 81e7003

File tree

1 file changed

+11
-11
lines changed
  • src/Advanced.Algorithms/DataStructures/Tree

1 file changed

+11
-11
lines changed

src/Advanced.Algorithms/DataStructures/Tree/B+Tree.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ public class BpTree<T> : IEnumerable<T> where T : IComparable
2424
private readonly int maxKeysPerNode;
2525
private readonly int minKeysPerNode;
2626

27+
public BpTree(int maxKeysPerNode = 3)
28+
{
29+
if (maxKeysPerNode < 3)
30+
{
31+
throw new Exception("Max keys per node should be atleast 3.");
32+
}
33+
34+
this.maxKeysPerNode = maxKeysPerNode;
35+
this.minKeysPerNode = maxKeysPerNode / 2;
36+
}
37+
2738
/// <summary>
2839
/// Time complexity: O(1).
2940
/// </summary>
@@ -52,17 +63,6 @@ public T Min
5263
}
5364
}
5465

55-
public BpTree(int maxKeysPerNode = 3)
56-
{
57-
if (maxKeysPerNode < 3)
58-
{
59-
throw new Exception("Max keys per node should be atleast 3.");
60-
}
61-
62-
this.maxKeysPerNode = maxKeysPerNode;
63-
this.minKeysPerNode = maxKeysPerNode / 2;
64-
}
65-
6666
/// <summary>
6767
/// Time complexity: O(log(n)).
6868
/// </summary>

0 commit comments

Comments
 (0)