Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactoring the ics23 spec #975
base: main
Are you sure you want to change the base?
refactoring the ics23 spec #975
Changes from all commits
9a079cd
52419f0
aa20aba
446f4d3
bbf3f44
c13f256
33bc57d
8534b5e
89f1559
99c6fe7
c690426
db92c4c
b2334dd
b81495c
60a2df4
4bcb8eb
de4cc26
2335cf9
3813404
8ff175a
2baba60
ac11ff5
c9f8ca0
2eea315
f2f5e2d
1115a51
5734cb4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Root's children is checked with
length(p) == 1
. If this would be a defined predicate, perhaps it would be more readable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand what is going on here. Does this only work if left and right don't contain an entry for
[1]
? Otherwise the expressionlwidth + p[0]
below would suddenly introduce keys whose value is greater than 1.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I remember, every node is encoded as the path to this node. For instance,
[0, 1, 0, 1]
in a binary tree would mean that you first go left, then right, then left, then right. So if we count the number of paths of length 1, then we get the number of root's children.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but if we have 2 root's children, we get
lwidth = 2
, but then two lines below we haveSo it seems that I could get a 2 and a 3 as first list entry, and this is what I don't understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That definition merges two trees. Say, if you have root's children
[0, 1]
in tree 1 and root's children[0, 1]
in tree 2, then you would like to have root's children[0, 1, 2, 3]
. This is what addition does for you: It simply renames the immediate root's children in tree 2, for all paths in that tree.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I just thought we would stay with binary trees...