2020-08-21 Subject source: http://www.h-camel.com/index.html
[html] Tell me what will happen if a link href="" (empty) is clicked?
The performance is: refresh the page
Generally, when the a tag is used as a button, the href value is empty when there is no need to jump.
If you do not need to jump, you need to set the value of href: <a href="javascript:void(0);">链接</a>
[css] How did you learn css? Talk about your learning method
Read more write more
[js] Write a method to implement tree path query [code]
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]
Transfer from https://blog.csdn.net/ulanlds/article/details/108463394
Another article to implement binary tree search https://blog.csdn.net/weixin_36185028/article/details/53967888
[Soft Skills] Tell me about your understanding of end-to-end delivery
End-to-end delivery actually refers to end-to-end contract delivery, with the contract as the main line, including the entire process of project initiation, bidding, contract signing, manufacturing/delivery/project preparation, project implementation and contract closure.
Demystifying: What exactly is Huawei's end-to-end delivery? https://www.jianshu.com/p/f19bf8444f0b