![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
常用的数据结构总结
Fwenxuan
这个作者很懒,什么都没留下…
展开
-
js----字典实现
// 字典 function Dictionary() { this.dataStore = new Array() } Dictionary.prototype = { constructor: Dictionary, // 添加元素 add: function (key, value) { this.dataStore[key] = value }, // 查找元素 find: function (key) { return this.dataStor原创 2020-05-22 09:15:51 · 251 阅读 · 0 评论 -
js实现编译原理------词法分析器
词法分析器 var inputCode = "int main (){console.log()}" /* * 规则: 识别保留字:if、int、for、while、do、return、break、continue; 单词种别码为1。 其他的都识别为标识符;单词种别码为2。 常数为无符号整形数;单词种别码为3。 运算符包括:+、-、*、/、=、>、<、>...原创 2020-04-27 20:25:34 · 810 阅读 · 0 评论 -
Js实现单链表操作
// 链表 // 创建节点的构造函数 function Node(element) { this.element = element // 初始的节点的next指向都为 null this.next = null } // 创建 链表类 function LList() { // 链表类的第一个头节点 this.head = new Node("head") } // ...原创 2020-04-27 16:30:00 · 264 阅读 · 0 评论