2017年4月10日

js集合set类的实现

摘要: js集合set类的实现 /*js集合set类的实现*/ function Set() { this.dataStore = []; this.add = add;//新增元素 this.remove = remove;//删除元素 this.size = size;//集合的元素个数 this.union = union;//求并集 this.co... 阅读全文

posted @ 2017-04-10 16:54 白杨-M 阅读(11163) 评论(0) 推荐(0) 编辑

JS字典 Dictionary类

摘要: 字典 Dictionary类 /*字典 Dictionary类*/ function Dictionary() { this.add = add; this.datastore = new Array(); this.find = find; this.remove = remove; this.showAll = showAll; this.co... 阅读全文

posted @ 2017-04-10 16:14 白杨-M 阅读(31211) 评论(1) 推荐(1) 编辑

js实现双向链表, 双向链表需要增加一个previous属性

摘要: 双向链表, 双向链表需要增加一个previous属性 /*双向链表 * */ function Node(element) { this.element = element; this.next = null; this.previous = null;//双向链表在这里需要增加一个previous属性 } function LList() { this.hea... 阅读全文

posted @ 2017-04-10 16:09 白杨-M 阅读(2095) 评论(0) 推荐(0) 编辑

JS实现一个基于对象的链表

摘要: JS实现一个基于对象的链表 /*JS实现一个基于对象的链表*/ function Node(element){ this.element = element;//节点存储的元素 this.next = null;//节点指向的下一个节点,这里先设置为空 } function LList(){ this.head = new Node("head");//生成一个头节点... 阅读全文

posted @ 2017-04-10 16:02 白杨-M 阅读(582) 评论(1) 推荐(1) 编辑

导航