Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
学号:2023120242
修改内容:
修复
maximumGap
方法:exp
的更新方式,从exp += 10
改为exp *= 10
,以确保基数排序按位进行。maximumGap
方法的返回值计算,保证它正确计算排序后的相邻元素的最大差值。增加测试用例:
L2023120242_4_Test
,增加了多个边界和常规场景的测试用例,确保代码的正确性和稳定性。testMaximumGapWithValidArray
:验证正常数组的最大差值。testMaximumGapWithSingleElement
:验证只有一个元素的数组(无差值)。testMaximumGapWithEmptyArray
:验证空数组(无差值)。testMaximumGapWithLargeNumbers
:验证数组中包含极大差值的情况。