The motivation for writing this book was the lack of resources available about data& A. R* F4 G9 {0 x
structures and algorithms written in JavaScript. This was strange to me because % h7 V* r5 k! P- Xtoday many of the job opportunities for software development require knowledge of9 A; O5 o: h }, |# U9 o0 ?% |
JavaScript; it is the only language that can be used to write the entire stack, including the! u( ?& C- H& j( S2 o$ t
front-end, mobile (native and hybrid) platforms, and back-end. It is crucial for JavaScript5 I8 M% `* h5 ]. {
developers to understand how data structures work and how to design algorithms to * P2 L$ d1 _$ rbuild applications. 0 y2 f3 Q, F( ~1 N! y& g3 xTherefore, this book aims to teach data structure and algorithm concepts from 1 m1 S4 B* v6 b+ o. Icomputer science for JavaScript rather than for the more typical Java or C++. Because* g; S# Z" c& o3 s3 e' f
JavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow 9 J/ C! E) Q! B7 v3 x4 \3 gthe inheritance pattern), there are some changes in writing data structures in JavaScript. 1 k9 E; C! V1 X6 s$ L I& W& ?The classical inheritance pattern allows inheritance by creating a blueprint-like ) C, R0 C5 m9 i7 ~$ K& h! p8 Jform8 U' j8 C5 W8 l# g& ?% q
that objects follow during inheritance. However, the prototypal inheritance pattern4 y/ {& B8 |, P: Y3 _& n* s* S/ s
means copying the objects and changing their properties.1 o3 H1 J/ V! ]1 j: [9 J# J
This book first covers fundamental mathematics for Big-O analysis and then lays out : K9 c% _, ]" U- ~, Uthe basic JavaScript foundations, such as primitive objects and types. Then, this book. S+ b, b8 O; h7 M0 u( a% g
covers implementations and algorithms for fundamental data structures such as linked k* Q1 s b9 ? R
lists, stacks, trees, heaps, and graphs. Finally, more advanced topics such as efficient0 A }9 J- p2 X: _2 Z4 W
string search algorithms, caching algorithms, and dynamic programming problems are 9 p5 j/ T# I" f# X0 Z) vexplored in great detail.5 ~, M1 V( s: {9 G
4 x" o" p0 `* [$ `# M