The motivation for writing this book was the lack of resources available about data 0 E" k; U0 m: i9 j qstructures and algorithms written in JavaScript. This was strange to me because0 O! \ d' V4 B( S% q$ x9 F$ K* R; P
today many of the job opportunities for software development require knowledge of % N3 `% Q3 N. ]5 \6 vJavaScript; it is the only language that can be used to write the entire stack, including the% s2 M7 _* I% T
front-end, mobile (native and hybrid) platforms, and back-end. It is crucial for JavaScript 7 g/ t( T) y6 c q' Ydevelopers to understand how data structures work and how to design algorithms to + U7 q- H5 X6 K. Jbuild applications.- f; ^0 i/ u3 I; X! u# t5 _
Therefore, this book aims to teach data structure and algorithm concepts from % k, z, z6 i% Z/ r s# `0 gcomputer science for JavaScript rather than for the more typical Java or C++. Because 7 v% Q- ?. D# @JavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow3 j8 D# O) d9 J# Z8 _# {
the inheritance pattern), there are some changes in writing data structures in JavaScript.( {0 _8 l9 X+ ^
The classical inheritance pattern allows inheritance by creating a blueprint-like* g6 w E: A) Z
form0 M5 \: ^. {: W" H5 `
that objects follow during inheritance. However, the prototypal inheritance pattern ; `$ c+ S' t' G: Kmeans copying the objects and changing their properties.2 `! z9 a* k6 n. b
This book first covers fundamental mathematics for Big-O analysis and then lays out& y7 q1 K) N* ^1 n" t0 G$ ]' M% n
the basic JavaScript foundations, such as primitive objects and types. Then, this book . Q9 U4 P! M" {/ J# C+ b J+ f5 Jcovers implementations and algorithms for fundamental data structures such as linked+ T$ u7 b0 n& p4 U7 @- g
lists, stacks, trees, heaps, and graphs. Finally, more advanced topics such as efficient6 g1 N5 ~5 X& R7 ^
string search algorithms, caching algorithms, and dynamic programming problems are% S3 w6 e, Y4 a' K/ x
explored in great detail. 6 J2 q, L$ F. K/ X; n / D6 u" C5 w0 e+ O9 k $ [7 O- `+ o c. Y2 N& b