The motivation for writing this book was the lack of resources available about data1 }4 l( Z a& z$ S- {- x& j; y
structures and algorithms written in JavaScript. This was strange to me because+ k$ H+ j. q2 X! H r( i& L! r5 ?
today many of the job opportunities for software development require knowledge of; Z, G8 W0 V5 ~9 ]0 f
JavaScript; it is the only language that can be used to write the entire stack, including the 2 z8 k2 T) w+ s! b% V* qfront-end, mobile (native and hybrid) platforms, and back-end. It is crucial for JavaScript# G# Q' q9 T8 [
developers to understand how data structures work and how to design algorithms to0 O+ |- v5 O% V1 S& k5 c$ v4 u2 B1 a
build applications.5 c4 y8 t# @2 H' C u% i
Therefore, this book aims to teach data structure and algorithm concepts from " x# F8 c2 ] u, W( S$ ^computer science for JavaScript rather than for the more typical Java or C++. Because2 e# a/ _' c) b' N7 D; K$ S$ b- S' H; B
JavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow7 h$ z: |4 C4 |' R1 j
the inheritance pattern), there are some changes in writing data structures in JavaScript.: u1 ~" F8 M2 _
The classical inheritance pattern allows inheritance by creating a blueprint-like4 Y7 b/ x3 {% R( J
form q9 J2 ^' h1 p, Xthat objects follow during inheritance. However, the prototypal inheritance pattern# q* i. @ d6 f: g$ N3 d
means copying the objects and changing their properties. / ~7 C% A9 s: [2 r i G7 M7 sThis book first covers fundamental mathematics for Big-O analysis and then lays out0 h; R) o t4 P3 S
the basic JavaScript foundations, such as primitive objects and types. Then, this book 5 e+ {, F# ]; z$ C0 q/ Qcovers implementations and algorithms for fundamental data structures such as linked $ X2 h& K: ~' Qlists, stacks, trees, heaps, and graphs. Finally, more advanced topics such as efficient% Y# C/ D: O9 E1 s* |. b
string search algorithms, caching algorithms, and dynamic programming problems are, U/ x3 @' i( A7 \* x
explored in great detail. 6 g; n- X/ n: c9 @% z& e [. c' @ j9 N$ [5 u7 m( n( l