
数据结构与算法javascript描述习题答案
文章平均质量分 80
哒哒哒二胡
这个作者很懒,什么都没留下…
展开
-
数据结构与算法JavaScript描述[第五章](队列)
1.修改Queue类,行程一个Deque类。这是一个和队列类似的数据结构,允许从队列两端添加和删除元素,因此也叫双向队列。写一段测试程序测试该类。 //双向队列 function Deque() {}; //继承队列 Deque.prototype = new Queue(); //重写队列 dequeue 方法 Deque.prototype.d原创 2017-01-04 16:42:38 · 452 阅读 · 0 评论 -
数据结构与算法JavaScript描述[第六章](链表)
//双向链表 var BLinkList = function () { this.head = new BNode('head'); this.find = function (item) { var currNode = this.head; while(currNode.element != item){原创 2017-01-05 22:12:27 · 818 阅读 · 0 评论 -
数据结构与算法JavaScript描述[第七章](字典)
//字典基类 function Dictionary() { this.dataStore = []; this.add = function (key,value) { this.dataStore[key] = value; }; this.find = function (key) {原创 2017-01-06 14:40:49 · 922 阅读 · 0 评论 -
数据结构与算法JavaScript描述[第二章](数组)
1.创建一个记录学生成绩的对象,提供一个添加成绩的方法,以及一个显示学生平均成绩的方法。var Grade = function () { var _this = this; //成绩存储 _this.gradeStore = []; //添加成绩 _this.add = function (name,scor原创 2016-12-31 15:55:23 · 1065 阅读 · 0 评论 -
数据结构与算法JavaScript描述[第三章](列表)
基础列表类var List = function () { var _this = this; _this.dataStore = []; _this.listSize = _this.dataStore.length; _this.pos = 0; //更新长度 _this.updateLeng原创 2016-12-31 17:29:27 · 1195 阅读 · 3 评论