A
A
Artur Aralin2019-12-01 09:38:57
Algorithms
Artur Aralin, 2019-12-01 09:38:57

How to generate posId for a new atom in treedoc?

I'm trying to make a co-editing editor based on crdt, but I can't figure out how the position key is generated.
Is there a place to read about how to implement insertion in treedoc? (not a scientific article, namely the implementation).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TheRonCronix, 2019-12-02
@TheRonCronix

Well, a binary tree is offered here: https://hal.inria.fr/inria-00445975/document. The pseudocode is there.
Or as a variant (not thought out) of a number with infinite precision:
for example, 1 < 2 < 3 < 4 ...
then we want to insert something between 1 and 2, we get: 1 < 11 < 12 < 13 < ... < 2
11 < 111 < 112 < ... < 12
...
In a computer the variant will be binary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question