2020-08-21 题目来源:http://www.h-camel.com/index.html
[html] 说说如果a链接href=""(空)时点击时会有什么表现?
表现就是:刷新页面
一般使用a标签来做按钮时,不需要跳转时,href的值为空。
如果不需要跳转,需要设置href的值: <a href="javascript:void(0);">链接</a>
[css] 你是怎么学习css的?说说你的学习方法
多看多写
[js] 写一个方法,实现树的路径查询[代码]
const binaryTree = {
id: 1,
left: {
id: 2,
left: {
id: 4,
left: {
id: 7,
left: null,
right: null
},
right: {
id: 5,
left: null,
right: null
}
},
right: {
id: 8,
left: null,
right: null
}
},
right: {
id: 3,
left: null,
right: {
id: 9,
left: null,
right: null
}
}
}
// 根据给定值,查找叶子节点(返回叶子节点和路径)
function searchLeaves (tree, key, pathList) { // 此方法只有两种返回值(Array、null)
if (!tree) return null
// 此方法是递归调用,考虑到首次不传pathList参数,此处做个判断
if (!pathList) pathList = []
pathList.push(tree.id)
if (tree.id === key) return pathList
let found
found = this.searchLeaves(tree.left, key, pathList)
if (found) return found
found = this.searchLeaves(tree.right, key, pathList)
if (found) return found
//执行到此处,说明当前节点的子树没找到,将当前节点pop出去
pathList.pop()
return found
}
let searchId = 5
let result = searchLeaves(binaryTree,searchId)
console.log(result)
// 输出 [1,2,4,5]
转自 https://blog.csdn.net/ulanlds/article/details/108463394
另一篇实现二叉树查找 https://blog.csdn.net/weixin_36185028/article/details/53967888
[软技能] 说说你对端到端交付的理解
端到端交付,实际上是指端到端的合同交付,以合同为主线,包括项目立项、投标、合同签订、制造/发货/工程准备、工程实施和合同关闭的整个过程。
揭秘:华为的端到端交付究竟是什么? https://www.jianshu.com/p/f19bf8444f0b