数据结构代码
文章目录
a是数据结构的:栈
const a = []
a.push (1)
a.push (2)
a.push (3)
const item = a.pop()a是数据结构的:队列
const a = []
a.push (1)
a.push (2)
a.push (3)
const item = a.shift()a最接近哪种数据结构:哈希表
const a = {
name:"frank",
age:18
}a最接近哪种数据结构:链表
const a = {
value:1,
next:{
value:2,
next:{
value:3,
next:null
}
}
}a最接近哪种数据结构:树
const a = {
value:1,
children:[{value:2,children:null},{value:3,children:[{value:4,children:null}]
}]
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论