Java – Test merge in merge sort

Is there any edge condition or general condition that I need to test this function The only thing I can think of is that one of the merged arrays is empty Do I need to consider other test cases?

Solution

For any type, I consider these situations:

>Empty list > sorted list > reverse sorted list > entire list of the same elements > list with spoofing

This can prove not only the algorithm, but also the performance

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>