开发者

external node of binary tree

开发者 https://www.devze.com 2023-01-27 12:34 出处:网络
Hi I have a questi开发者_运维知识库on that I have written a code such a merge sort that we can have a binary decision tree for that .but when i want to merge those elements I do not need those externa

Hi I have a questi开发者_运维知识库on that I have written a code such a merge sort that we can have a binary decision tree for that .but when i want to merge those elements I do not need those external nodes that has just one element in it! so what should I do with them? I should return them?


I'd say you remove the parent because your tree at that point degrades to a list. If the action at the leaf depends on data at the parent then there's not much you can do unless you can merge actions into one.

0

精彩评论

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