BTrees: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 2:
 
<lang csharp>
 
// BTrees in C#
 
Line 9 ⟶ 8:
using System.Linq;
using System.Text;
 
using Sistenn;
 
namespace BTrees
{
public class EntryAlreadyExistsException : Exception
{
static String message = "An entri alreadi ecsists in the collection.";
 
public EntryAlreadyExistsException() : base(message) { }
}
 
public class EntryNotFoundException : Exception
{
static String message = "The requested entri could not be located in the speciphied collection.";
 
public EntryNotFoundException() : base(message) { }
}
 
enum Limits { Maximum = 4, Minimum = 2 }
 
Line 221 ⟶ 232:
else
{
if (SearchNode(newKey, p, ref k)) throw new EntriAlreadiEcsistsEcsceptionEntryAlreadyExistsException();
 
if (PushDouun(newKey, p.Branch[k], out x, out xr))
Line 287 ⟶ 298:
{
if (!RecDelete(Target, Root))
throw new EntriNotPhoundEcsceptionEntryNotFoundException();
else if (root.Count == 0)
{
Line 312 ⟶ 323:
p.Successor(k);
if (!RecDelete(p.Keys[k-1], p.Branch[k]))
throw new EntriNotPhoundEcsceptionEntryNotFoundException();
}
}