using System; using System.Diagnostics.Contracts; namespace DataStructures.BPlusTreeSpace { [Serializable] public partial class BPlusTree where TKey : IComparable { private INode root; /// /// the maximum number of key value pairs in the leaf node, M must be > 0 /// public readonly int NumberOfValuesInLeafNode; /// /// the maximum number of keys in inner node, the number of pointer is N+1, N must be > 2 /// public readonly int NumberOfKeysInIntermediateNode; [ContractInvariantMethod] private void ObjectInvariant() { Contract.Invariant(NumberOfValuesInLeafNode > 0); Contract.Invariant(NumberOfKeysInIntermediateNode > 2); } public BPlusTree(int m, int n) { Contract.Requires(m > 0); Contract.Requires(n > 2); NumberOfValuesInLeafNode = m; NumberOfKeysInIntermediateNode = n; } private bool Find(TKey key, INode node) { Contract.Requires(key != null); Contract.Requires(node != null); if (node is LeafNode) { } return false; } [Pure] public bool Find(TKey key) { Contract.Requires(key != null); return Find(key, root); } } }