The motivation for writing this book was the lack of resources available about data - @3 \3 I2 n! Q9 {' [4 rstructures and algorithms written in JavaScript. This was strange to me because" f5 `( ~1 i V" E6 e: B" e
today many of the job opportunities for software development require knowledge of& a- N7 {7 c. L, A- N
JavaScript; it is the only language that can be used to write the entire stack, including the . K& R/ z% }# l6 v% E' ~( Zfront-end, mobile (native and hybrid) platforms, and back-end. It is crucial for JavaScript ' q7 [+ r- S/ ~2 {& Y6 x& }; gdevelopers to understand how data structures work and how to design algorithms to# O" t0 Y( ]- E, W0 ~! p
build applications. 3 F) M3 T% Q' [2 U& [Therefore, this book aims to teach data structure and algorithm concepts from 3 Y. g7 R, l; B8 }computer science for JavaScript rather than for the more typical Java or C++. Because7 N: t8 M) Z" q% X7 c5 O. L% X& S
JavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow 3 [ n; [( o# T6 h) Q- G3 Bthe inheritance pattern), there are some changes in writing data structures in JavaScript. . m e% K6 L6 d3 |# |The classical inheritance pattern allows inheritance by creating a blueprint-like# \9 b, P, c1 D5 B3 K
form . O1 g& ]: Y# H4 Z9 nthat objects follow during inheritance. However, the prototypal inheritance pattern+ v2 b# y& T. T9 r- |2 @, D( y
means copying the objects and changing their properties.7 K, W% n; o. ~# R8 V2 Q& x( U
This book first covers fundamental mathematics for Big-O analysis and then lays out* N( V" W( |: J! [0 Z2 n, ?
the basic JavaScript foundations, such as primitive objects and types. Then, this book0 E" `0 z F( l) h5 s# v2 B! W$ J
covers implementations and algorithms for fundamental data structures such as linked 8 l9 ~$ G, C, a4 T; f4 \lists, stacks, trees, heaps, and graphs. Finally, more advanced topics such as efficient2 V2 A! }/ z1 U* W# o6 @5 t
string search algorithms, caching algorithms, and dynamic programming problems are $ p1 ~( ^3 R( ^& cexplored in great detail. e6 c8 ~/ n9 H2 F. q, o5 @% W h0 ]
. v. s: S$ Z* T9 }