Skip to content
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

Question about Entry & Cursor #399

Closed
mjy0503 opened this issue Oct 16, 2019 · 3 comments
Closed

Question about Entry & Cursor #399

mjy0503 opened this issue Oct 16, 2019 · 3 comments

Comments

@mjy0503
Copy link

mjy0503 commented Oct 16, 2019

If I insert "FOO", tree should have root node and leaf node only.

Then, I search "FO", Entry has

Cursor

  • depth: 2
  • parent: root
  • child: leaf
  • index: 0
  • length: 2

Key: None

When lookup function evaluates, it should be failed.
Because child.header.length(3, "FOO") is not equal self.cursor.length(2, "FO")

What is wrong?

Thanks

@mjy0503
Copy link
Author

mjy0503 commented Oct 16, 2019

I Add another question

I insert "FA", "FB". Tree has this shape.
            B
         --------------> N3
    F    |   A
root ----------> N1 -------------> N2

I search "F", Entry is

Cursor

  • depth:1
  • parent:root
  • child:N1
  • index:0
  • length:1

Key:None

When lookup function evaluates,
child.header.length(1, "F") is equal to self.cursor.length(1, "F")
and try to return body.

What is wrong in this case?

@jeehoonkang
Copy link
Member

  • I cannot understand your first question. What are you asking for?
  • encode_key() makes sure that a key should never be a prefix of another key. So inserting FA and then looking up F is impossible.

@mjy0503
Copy link
Author

mjy0503 commented Oct 16, 2019

Oh, I don't recognize about encode_key()
First case is similar as second one. "FO" is prefix of "FOO", so don't happen.

Thanks

@mjy0503 mjy0503 closed this as completed Oct 16, 2019
@kyeongmincho kyeongmincho transferred this issue from kaist-cp/helpdesk Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants