Talk:Algorithm Implementation/Trees/B+ tree

where are the headers to 85.48.160.4 (discuss) 21:07, 24 March 2014 (UTC)

Where's the delete function?

As to the implementation itself, it looks somewhat over the top ... overengineered, I mean. Why pass N, M as parameters to a constructor! People make fine macro interpreters. Put static final int M=4; static final int N=4; in the class and you'll find that you get rid of a superflous constructor. People are smart enough to change the numbers as they wish, and smart enough to complicate up their own constructors!

Anyway .. what's "N"? Keys in inner nodes? Eh? Are you confusing keys and pointers? This whole thing is just mysterious. I suspect what you have called LNode is really Leaf. What you have is clear as mud, but it looks as though there's hope. It seems like the English used is bad, which may be the reason for much of my puzzlement.

Anyway, you need to define the strutcure up top, so Node and Leaf definitions must come first. Avoid silly generalizations. People abstract fine by themselves. Those casts are nutty. but remove the comments that say so .. that's worse. And enough of the Leaf extends Node extends I don't know what. Each must be independently defined for clarity. Remove the protected business too .. it serves for nothing. Remove all abstract stuff.

Ditto on dropping that compareTo nonsense. Use == ! or whatever. People abstract fine by themselves. Don't do it for them. It obscures.

Also, most comments break the 80 char per line limit.

Yep - that code is so confusing, it needs radical revision.

85.48.160.4 (discuss) 21:07, 24 March 2014 (UTC)