摘要: /* * 单向链表 * Node 类用来表示节点 * LinkedList 类提供了插入节点、删除节点、显示列表元素的方法,以及其他一些辅助方法。 */ function Node(element) { this.element = element; this.next = null; }; function LList() { this.head =... 阅读全文
posted @ 2017-11-07 15:56 柠檬张先生 阅读(502) 评论(0) 推荐(0)
摘要: function Queue() { this.dataStore = []; } Queue.prototype = { constrcutor: Queue, enqueue: function(element) { this.dataStore.push(element); }, dequeue: function() { ... 阅读全文
posted @ 2017-11-07 11:11 柠檬张先生 阅读(281) 评论(1) 推荐(0)
摘要: function Stack() { this.dataStore = []; //存储栈元素 } Stack.prototype = { constructor: Stack, push: function(element) { this.dataStore.push(element) }, pop: function() { ... 阅读全文
posted @ 2017-11-07 08:40 柠檬张先生 阅读(471) 评论(1) 推荐(0)