The motivation for writing this book was the lack of resources available about data# u" } }) W! f8 C
structures and algorithms written in JavaScript. This was strange to me because 1 L1 F$ _0 X& R+ ~0 S. h$ z# @) Ttoday many of the job opportunities for software development require knowledge of8 q2 I7 f" o, J! w2 h1 q; ^
JavaScript; it is the only language that can be used to write the entire stack, including the $ Q( x. G/ K2 Ffront-end, mobile (native and hybrid) platforms, and back-end. It is crucial for JavaScript 6 c8 R2 Q% K) ~3 Vdevelopers to understand how data structures work and how to design algorithms to ! N ], C; t# M. Xbuild applications.' P$ X2 \& v0 t6 x% z
Therefore, this book aims to teach data structure and algorithm concepts from; z8 V2 |# Y* G' x
computer science for JavaScript rather than for the more typical Java or C++. Because ' j0 f, s; H7 y. d; N/ f; V, kJavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow( ^7 w2 ^ ?8 y- t; D; t* g
the inheritance pattern), there are some changes in writing data structures in JavaScript. . K8 j/ q- n6 p( C0 U8 TThe classical inheritance pattern allows inheritance by creating a blueprint-like1 B. B/ P2 n) u
form3 I1 \* ? J8 q. r) R* O1 s l3 b
that objects follow during inheritance. However, the prototypal inheritance pattern/ y% M" y' g2 _2 n3 l' _8 m
means copying the objects and changing their properties.- E: e# B' V5 A( i. O; Y9 I) f
This book first covers fundamental mathematics for Big-O analysis and then lays out 3 S. X: q: H$ V( x5 pthe basic JavaScript foundations, such as primitive objects and types. Then, this book ' U: J. j: R2 y* I5 {covers implementations and algorithms for fundamental data structures such as linked; @% b) A3 S# {- @
lists, stacks, trees, heaps, and graphs. Finally, more advanced topics such as efficient a `4 r: w* h& q8 r9 X
string search algorithms, caching algorithms, and dynamic programming problems are 3 v& N! [/ Z. N. o* ~explored in great detail. ( V, b8 r3 b2 Y" n1 W6 v/ X* {$ g) H7 t) p% c, ^( v