摘要:function CArray(numElements) { this.dataStore = []; this.pos = 0; this.numElements = numElements; this.insert = insert; this.toString = toString; this.clear = clear; this.setData = setData; t...
阅读全文
摘要:function Node(data, left, right) { this.data = data; this.left = left; this.right = right; this.show = show; } function show() { return this.data; } function BST() { this.root = null; this.i...
阅读全文
摘要:function Set() { this.dataStore = []; this.add = add; this.remove = remove; this.size = size; this.union = union; this.intersect = intersect; this.subset = subset; this.difference = differenc...
阅读全文
摘要:function Stack() { this.dataStore = []; this.top = 0; this.push = push; this.pop = pop; this.clear = clear; this.peek = peek; this.length = length; } function push(element) { this.dataStore[...
阅读全文
摘要:var fs=require('fs'); function Queue() { this.dataStore = []; this.enqueue = enqueue; this.dequeue = dequeue; this.front = front; this.back = back; this.toString = toString; this.empty = empt...
阅读全文
摘要:function HashTable() { this.table = new Array(137); this.simpleHash = simpleHash; this.showDistro = showDistro; this.put = put; //this.get = get; } function put(data) { var pos = this.simpleHa...
阅读全文
摘要:function Dictionary(){ this.datastore={}; this.add=add; this.find=find; this.remove=remove; this.showAll=showAll; } function add(key,value){ this.datastore[key]=value; } function find(key){ ...
阅读全文
摘要:function Checking(amount){ if(amount){ this.banlance=amount; }else{ this.banlance=0; }; this.deposit=function(dep){ this.banlance+=dep; }; this.withdraw=func...
阅读全文
摘要:function List() { this.listSize = 0; this.pos = 0; this.dataStore = []; // 初始化一个空数组来保存列表元素 this.clear = clear; this.find = find; this.toString = toStri...
阅读全文