Skip to content

(Solution4)2023111998-王乐天#416

Open
2023111998 wants to merge 2 commits intoHanchuanXu:mainfrom
2023111998:fix
Open

(Solution4)2023111998-王乐天#416
2023111998 wants to merge 2 commits intoHanchuanXu:mainfrom
2023111998:fix

Conversation

@2023111998
Copy link
Copy Markdown

学号:2023111998 姓名:王乐天

修改思路:

  1. 算法逻辑修复:

    • 修复基数排序中的循环范围错误,将所有使用'n'的地方改为'nums.length'
    • 修正指数exp的更新逻辑,从'exp += 10'改为'exp *= 10'
    • 修复System.arraycopy()中的数组拷贝长度参数错误
    • 添加缺失的循环闭合括号,修复语法错误
  2. 测试类添加:

    • 创建L2023111998_4_Test.java测试类
    • 采用等价类划分原则设计测试用例
    • 包含8个测试方法,覆盖边界情况、正常情况、特殊情况
    • 每个测试方法前都注明测试目的和测试用例
  3. 验证结果:

    • 使用JUnit单元测试框架
    • 所有8个测试用例全部通过
    • 代码符合线性时间复杂度和线性空间复杂度要求

…ve test cases

- Fixed loop range errors in radix sort algorithm
- Corrected exp update logic from +=10 to *=10
- Fixed array copy length parameters
- Added L2023111998_4_Test.java with 8 test cases
- All tests passed successfully using JUnit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant