Git Product home page Git Product logo

Comments (3)

amit-davidson avatar amit-davidson commented on June 15, 2024

Hey @wortelus :)
I'm not sure how you got to the tree you mention from the code you added.

  1. How did you create the 2-3 tree?
  2. And how did you remove items? What was your starting tree?

from btree.

wortelus avatar wortelus commented on June 15, 2024

Hi :) thanks for the quick response!

If I understand your code correctly, 2-3 tree should be created by setting minimumItemsInNode := 1 in NewTree(minimumItemsInNode), as 2-3 tree has minimum key count of 1 and max key count of 2.

After that I just looped by putting the values 1..2..3..4 etc. by Put, as you can see in my code attachment
I didn't remove any items, I just noticed in debugging, that there is at the second layer on right of root impossible combination on inner node with value "6", containing 3 other nodes as children, with values of (3), (5, 8), (7) in the memory.

I did not find out why would that be :/

from btree.

amit-davidson avatar amit-davidson commented on June 15, 2024

I'll take a look at it and let you know.

from btree.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.