We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
全排列算法
https://segmentfault.com/a/1190000013434175
多层嵌套数组去重排序
var arr = [ [1, 2, 2], [3, 4, 5, 5], [6, 7, 8, 9, [11, 12, [12, 13, [14] ] ] ], 10]; function isArray(item) { return Object.prototype.toString.call(item) === '[object Array]'; } // // 方法一 // function flat(arr){ // var newArr = arr.toString().split(","); // var tempArr = []; // newArr.map(item => { // if(tempArr.indexOf(item) < 0){ // tempArr.push(item); // } // }) // return tempArr.map(t => +t).sort((a,b)=>{ return a-b}); // } // 方法二 es6版本 function flat (arr) { function toFlat (acc, current) { if (Array.isArray(current)) { current.forEach(item => { toFlat(acc, item) }) } else { if (!acc.includes(current)) { acc.push(current) } } return acc } return arr.reduce(toFlat, []).sort((value1, value2) => value1 - value2) } // 方法三 es5版本 function flat (arr) { function toFlat (acc, current) { if (isArray(current)) { for(var i=0;i<current.length;i++){ toFlat(acc, current[i]) } } else { if (acc.indexOf(current) < 0) { acc.push(current) } } return acc } var newArr = []; for(var j = 0; j < arr.length; j++){ if(isArray(arr[j])){ newArr = newArr.concat(toFlat([], arr[j])) } else { newArr.push(arr[j]) } } return newArr.sort((value1, value2) => value1 - value2) } var newArr = flat(arr); console.log(newArr)
https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/8
两个升序数组,合并为一个新的升序数组,注意不能使用concat和sort方法
https://blog.csdn.net/u012194956/article/details/79388856 http://xuhong.github.io/2014/04/01/concatsort/
归并排序
https://segmentfault.com/a/1190000008866524
设计一个桌球游戏,写出包括球、球杆、球桌和游戏主程序类
TODO
图的深度优先遍历与广度优先遍历
深度优先遍历与广度优先遍历 sisterAn/blog#25
JS数组常用算法详解
JS数组常用算法详解 yygmind/blog#4
单链表
JavaScript中的数据结构 lvwxx/blog#1 (comment)
递归、二叉树
https://juejin.im/post/5b72f0caf265da282809f3b5#heading-0
什么是红黑树 https://juejin.im/post/5a27c6946fb9a04509096248
控制并发数
https://juejin.im/post/5dad327951882508652e525e#heading-7 参照 https://github.com/timdp/es6-promise-pool
The text was updated successfully, but these errors were encountered:
No branches or pull requests
全排列算法
https://segmentfault.com/a/1190000013434175
多层嵌套数组去重排序
两个升序数组,合并为一个新的升序数组,注意不能使用concat和sort方法
https://blog.csdn.net/u012194956/article/details/79388856
http://xuhong.github.io/2014/04/01/concatsort/
归并排序
https://segmentfault.com/a/1190000008866524
设计一个桌球游戏,写出包括球、球杆、球桌和游戏主程序类
图的深度优先遍历与广度优先遍历
深度优先遍历与广度优先遍历 sisterAn/blog#25
JS数组常用算法详解
JS数组常用算法详解 yygmind/blog#4
单链表
JavaScript中的数据结构 lvwxx/blog#1 (comment)
递归、二叉树
https://juejin.im/post/5b72f0caf265da282809f3b5#heading-0
什么是红黑树
https://juejin.im/post/5a27c6946fb9a04509096248
控制并发数
https://juejin.im/post/5dad327951882508652e525e#heading-7
参照 https://github.com/timdp/es6-promise-pool
参考资料
The text was updated successfully, but these errors were encountered: