The motivation for writing this book was the lack of resources available about data; c6 x( X- X3 h. C3 k% L5 j5 S
structures and algorithms written in JavaScript. This was strange to me because + q) V* ^& a! z3 Z; K' V! Jtoday many of the job opportunities for software development require knowledge of5 {( P5 C, F4 o; Q
JavaScript; it is the only language that can be used to write the entire stack, including the& S6 d* W( J+ A9 A# u$ I
front-end, mobile (native and hybrid) platforms, and back-end. It is crucial for JavaScript 3 {# J% ^; ? zdevelopers to understand how data structures work and how to design algorithms to0 S# |2 l5 e+ B8 k
build applications.( V4 B, f' i& r" u% K
Therefore, this book aims to teach data structure and algorithm concepts from % G* U/ }4 U: l' Pcomputer science for JavaScript rather than for the more typical Java or C++. Because 5 H I" R+ u6 r4 [ L( D- _3 wJavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow* B# c5 i$ ^. }5 ?$ g6 J2 _, \
the inheritance pattern), there are some changes in writing data structures in JavaScript. & W+ L/ z( z+ Y+ t. I3 B5 kThe classical inheritance pattern allows inheritance by creating a blueprint-like 1 ~- H7 C& y7 k" K" |5 e& i7 tform6 q1 U% a9 g" f2 L: B. Q
that objects follow during inheritance. However, the prototypal inheritance pattern$ h. K; D( n" U0 V/ S1 d
means copying the objects and changing their properties. 2 m7 Y9 a0 w8 T6 }6 GThis book first covers fundamental mathematics for Big-O analysis and then lays out2 o; C. Z: D M: |0 R1 U
the basic JavaScript foundations, such as primitive objects and types. Then, this book 8 @3 d4 U7 v8 R1 s. ocovers implementations and algorithms for fundamental data structures such as linked$ J9 y- I3 z# W7 [
lists, stacks, trees, heaps, and graphs. Finally, more advanced topics such as efficient6 r3 B3 f% f! m9 }7 ^8 k7 g- I
string search algorithms, caching algorithms, and dynamic programming problems are4 }- Y4 G6 A: k- O
explored in great detail. - T0 ?: K7 [* U1 ]8 W: u0 L" N1 c$ A) R4 X# |
, J2 U& c9 T. t" ~