File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
src/Advanced.Algorithms/DataStructures/Tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,17 @@ public class BpTree<T> : IEnumerable<T> where T : IComparable
24
24
private readonly int maxKeysPerNode ;
25
25
private readonly int minKeysPerNode ;
26
26
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
+
27
38
/// <summary>
28
39
/// Time complexity: O(1).
29
40
/// </summary>
@@ -52,17 +63,6 @@ public T Min
52
63
}
53
64
}
54
65
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
-
66
66
/// <summary>
67
67
/// Time complexity: O(log(n)).
68
68
/// </summary>
You can’t perform that action at this time.
0 commit comments