开发者

What is the performance tradeoff with BST implemented using linked list or array?

开发者 https://www.devze.com 2023-03-20 02:48 出处:网络
I was just wondering what would be the perfor开发者_运维技巧mance ratio, between binary search tree implemented using a linked and a binary search tree implemented using an array. I just want to know

I was just wondering what would be the perfor开发者_运维技巧mance ratio, between binary search tree implemented using a linked and a binary search tree implemented using an array. I just want to know the performance comparisons. I've already read this question in stackoverflow.


I do not think you can implement a binary search tree with an array. A binary search tree is like an advanced linked list. In fact, if you use a basic BST (not balancing) and input presorted data, you basically end up with a linked list.

0

精彩评论

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