This is an introductory book on data structures and algorithms built around JavaScript, translated from Data Structures and Algorithms with JavaScript published by O'Reilly. The author, Michael McMillan, is both a university instructor and a programmer. The book centers on JavaScript's language characteristics—"arrays are objects, global variables are everywhere, and there is a prototype-based object model"—and discusses how to implement the data structures and algorithms common in traditional programming languages (such as C++ and Java) in this environment, while pointing out how to weigh performance against implementation. The book has 14 chapters. Chapter 1 lays out JavaScript's programming environment and language model, including variable declarations, arithmetic and math functions, conditional and loop structures, functions, variable scope, recursion, and objects and object-oriented programming, establishing a unified code foundation for later chapters. Chapter 2 begins the main treatment of data structures: it first covers the most commonly used arrays, including accessor functions, mutator functions, iterator methods, two-dimensional and multidimensional arrays, and arrays of objects; it then implements, in turn, lists, stacks, queues, linked lists (including doubly linked lists and circular linked lists), dictionaries, hashing (including open chaining and linear probing for collision handling), sets, binary trees and binary search trees, and graphs and graph algorithms (depth-first, breadth-first, shortest path, topological sorting). The final three chapters focus on algorithms: Chapter 12 compares the three basic sorts—bubble, selection, and insertion—with the three advanced sorts—Shell, merge, and quick—on a unified array test platform; Chapter 13 covers sequential search, binary search, and self-organizing data; Chapter 14 introduces dynamic programming (Fibonacci numbers, longest common substring, knapsack problem) and greedy algorithms (the coin-changing problem and the greedy solution to the knapsack problem). Each chapter ends with exercises so readers can implement as they read.
如果你是从前端转向计算机基础的「跨界」程序员,这本书的价值在于它不假定你学过 C 或 Java。作者把栈、队列、链表、散列、树、图这些教科书里的经典结构,全部用你每天在写的 JavaScript 重新实现一遍,代码短小、可直接运行,读起来没有语言迁移的额外负担。 全书结构清晰得像一条流水线:先补语言基础,再按线性结构、非线性结构、排序查找、高级算法的顺序推进,每章末尾都有练习题。第 12 章用统一的测试平台横向比较各种排序算法的实际耗时,第 8 章讨论散列碰撞的两种经典处理方式,这些内容对理解「为什么这样写更快」很有帮助。 需要提醒的是,本书篇幅不大,定位是入门引路而非深入剖析,对复杂度的理论推导着墨有限,代码也基于较早的 ECMAScript 版本。它更适合作为「第一次用 JavaScript 把数据结构写出来」的动手读物,配合更系统的算法教材一起使用效果更好。
Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.