# mt_3th **Repository Path**: ayqy/mt_3th ## Basic Information - **Project Name**: mt_3th - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-09-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #mt_3th ###更新log: 1th submit.方法1存在重复元素bug 2th submit.修复方法1的bug,性能测试 3th submit.添加 界面易用性衡量指标.md ###task 1. 解题方案 后去重和先去重两种实现 具体实现见file: solution/solution.js 简单测试见file: solution/index.html 2. 工程化(性能测试) 简单性能测试,先去重的实现从时间复杂度上就优于后去重 见file: solution/profile.html 3. 关于界面易用性的想法(数据统计) 见file: 界面易用性衡量指标.md ##题目 输入: 由'abcdefghijklmnopqrstuvwxyz0123456789'中元素组成的数组 var arr = ['13b','aab','asdfasdf','a','baa','31b']; 输出: console.log(result); result = [['13b','31b'],['aab','baa']] ##性能测试 ###测试结果 数据量 串长 数据重复率 方法1:后去重 方法2先去重 现象 1000 rand 低 25.860ms 19.396ms 二者时耗相差几百ms,方法2并不总比1快 10000 rand 低 799.401ms 788.221ms 1000 2 高 10.724ms 5.672ms 时耗有很大差异,方法2更快 10000 2 高 714.511ms 18.573ms 1000 1 极高 11.608ms 17.825ms 二者时耗相差不多,方法2并不总比1快 10000 1 极高 1356.806ms 892.771ms ###测试结果分析: 1. 串长和数据重复率是性能的主要影响因素 2. 用Hash表先去重(方法2)在串较短且数据重复率较高时有明显的优势 ###从实现的角度分析: 1. 先去重要比后去重实现起来更容易 2. 后去重的时间复杂度是O(n^3)级的,先去重是O(n^2)级的,而且先去重能够减少筛选部分需要处理的数据量