Files
metagpt-JS-UI-20260326/docs/task/20260326152929.json
2026-03-26 15:33:47 +09:00

1 line
1.9 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"Required packages":["No third-party dependencies required"],"Required Other language third-party packages":["No third-party dependencies required"],"Logic Analysis":[["quickSort.js","包含 QuickSort 核心模块。实现 quickSort(arr: number[], descending: boolean) 公开方法:处理边界情况(空数组、单元素数组直接返回);选取中间元素作为 pivot调用内部 partition 私有逻辑将数组分为 left小于pivot、middle等于pivot、right大于pivot三部分根据 descending 参数决定升序或降序递归合并。无外部依赖,使用 module.exports 导出 quickSort 函数。"],["index.js","包含 Main 入口模块。实现 run() 函数:从 quickSort.js 导入 quickSortrequire('./quickSort'));定义多组测试数组 testArrays包括空数组、单元素数组、普通乱序数组、已排序数组依次调用 quickSort 进行升序和降序排序,并通过 console.log 输出验证结果。依赖 quickSort.js需在 quickSort.js 完成后实现。"]],"Task list":["quickSort.js","index.js"],"Full API spec":"","Shared Knowledge":"`quickSort.js` 是项目核心模块,导出唯一公共函数 `quickSort(arr, descending)`。参数说明:`arr` 为待排序的数字数组,`descending` 为布尔值(默认 false 表示升序true 表示降序)。返回值为排序后的新数组,不修改原数组。边界情况处理:空数组和单元素数组直接返回原数组。`index.js` 通过 `require('./quickSort')` 引入该函数并执行示例验证。","Anything UNCLEAR":"1) 降序排序参数 `descending` 默认值为 false升序调用时可选传入 true 实现降序已明确纳入实现2) 本实现假设输入均为数字数组不处理非数字元素过滤若后续有混合类型输入需求需额外扩展3) 代码兼容 Node.js 运行环境(使用 CommonJS module.exports/require同时核心逻辑也可在浏览器环境中使用。"}