开发者

Convert Sorted Array to Balanced 2-3-4 B tree

Given an array where elements are sorted in ascending order,and I need convert it to a 2-3-4 tree

I thought of a recursion which create every loop n开发者_如何转开发/3 nodes, choosing the maximum, and now I'm having hard time in understanding how to conitinue, It doesn't seem to work this way.

Thank you.


create an empty almost full tree, and then fill the tree with the array in an inorder search on the empty tree

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜