![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
队列
Is Anonymous
这个作者很懒,什么都没留下…
展开
-
队列与栈代替递归【队列】【栈】
基于对象数据是引用传递的特点,利用栈的的先进先出的来对每一个对象添加一个data属性let nums = [ { children: [{ children: [] }, { children: [] }, { children: [] } ]原创 2022-04-14 12:29:53 · 2102 阅读 · 0 评论 -
深克隆【回溯】【队列】
没什么说的var a = { b: { c: [{ c: 3 }] }, e: [{ a: 2 }]}function deepClone(obj) { let result = Array.isArray(obj) ? [] : {} for (const key in obj) { const thisValue = obj[key] if (thisValue.constructor===Array||thisValu原创 2022-04-21 14:32:36 · 3020 阅读 · 0 评论