The motivation for writing this book was the lack of resources available about data/ f ?* r! I, h
structures and algorithms written in JavaScript. This was strange to me because ) Z- U/ d" F: P. \2 D. jtoday many of the job opportunities for software development require knowledge of! ?- E" I2 j/ ?5 }8 U3 {) `; Z+ T
JavaScript; it is the only language that can be used to write the entire stack, including the 4 T, I8 Q! K. }7 ^front-end, mobile (native and hybrid) platforms, and back-end. It is crucial for JavaScript 6 H O; D3 S, J! F$ K r- ndevelopers to understand how data structures work and how to design algorithms to F9 C8 b# {4 q' m3 E3 R: Qbuild applications.9 }" b% H: ]; N1 D
Therefore, this book aims to teach data structure and algorithm concepts from/ m5 I" C! U# M }1 {
computer science for JavaScript rather than for the more typical Java or C++. Because ( ]7 s2 @, F7 k4 K. Y; c6 u2 PJavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow $ _5 Z3 t2 ~; p$ V& a! Y6 pthe inheritance pattern), there are some changes in writing data structures in JavaScript. 4 S* s0 F9 [+ r6 X. g! JThe classical inheritance pattern allows inheritance by creating a blueprint-like% y9 l+ d5 i1 v |5 a" L: ^* \# L0 H1 K' U
form5 x( R& L( m3 Y1 |3 g6 u) s
that objects follow during inheritance. However, the prototypal inheritance pattern& y4 S' v1 k" O* l( S( Z- h
means copying the objects and changing their properties. ( k* v7 X5 s& c0 a( d' }This book first covers fundamental mathematics for Big-O analysis and then lays out( O3 p3 Q) ]: [5 Q
the basic JavaScript foundations, such as primitive objects and types. Then, this book% |: I3 q N8 Z4 N" X
covers implementations and algorithms for fundamental data structures such as linked h% V& J& }& x( d) Blists, stacks, trees, heaps, and graphs. Finally, more advanced topics such as efficient $ c9 o; I: c: p7 r. `; b1 n: Bstring search algorithms, caching algorithms, and dynamic programming problems are 5 E) ?# W' C* F# [, A; wexplored in great detail., X& V7 C" G, ~' j
9 e" s0 t' A+ s# u$ _4 y, y' c ?# V0 G6 k6 P7 X% d0 L# @3 w