Skip to content

Commit

Permalink
Update rbtree.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar authored Jan 24, 2025
1 parent 5a026cb commit 5594519
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions notes/rbtree.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct Node<T> {
}
```

## BTree
## BTree23

```ts
type Root<T> = Node<T> | null
Expand All @@ -61,15 +61,15 @@ type Node2<T> = eadonly[Node<T>, T, Node<T>, T, Node<T>]
```
```rust
enum Node<T> {
Leaf1(Leaf1<T>),
Leaf2(Leaf2<T>),
Node1(Node1<T>),
Node2(Node2<T>),
enum NodeRef<T> {
Leaf1(&Leaf1<T>),
Leaf2(&Leaf2<T>),
Node1(&Node1<T>),
Node2(&Node2<T>),
}

struct Leaf1<T>(T);
struct Leaf2<T>(T,T);
struct Node1<T>(&Node<T>, T, &Node<T>);
struct Node2<T>(&Node<T>, T, &Node<T>, T, &Node<T>);
struct Node1<T>(NodeRef<T>, T, NodeRef<T>);
struct Node2<T>(NodeRef<T>, T, NodeRef<T>, T, NodeRef<T>);
```

0 comments on commit 5594519

Please sign in to comment.