Skip to content

Commit

Permalink
Node nomeclature
Browse files Browse the repository at this point in the history
  • Loading branch information
n8allan committed Mar 5, 2024
1 parent da84941 commit 7eba53b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ export interface ITreeNode { }

export class LeafNode<TEntry> implements ITreeNode {
constructor(
public entries: TEntry[], // These don't move so that they can be externally referenced -- only inserted and deleted (ordering happens through sequence)
public entries: TEntry[],
) { }
}

export class BranchNode<TPartition> implements ITreeNode {
export class BranchNode<TKey> implements ITreeNode {
constructor(
public partitions: TPartition[],
public nodes: ITreeNode[], // has capacity plus one, since partitions split nodes
public partitions: TKey[], // partition[0] refers to the lowest key in nodes[1]
public nodes: ITreeNode[], // has one more entry than partitions, since partitions split nodes
) { }
}

0 comments on commit 7eba53b

Please sign in to comment.