The motivation for writing this book was the lack of resources available about data 8 Y7 V1 w% m5 E6 w( S" ?* c' \. m1 bstructures and algorithms written in JavaScript. This was strange to me because / f- ]3 [. W! T: ]today many of the job opportunities for software development require knowledge of ; O8 @ @7 n) b' L: ?5 \# N% oJavaScript; it is the only language that can be used to write the entire stack, including the ' L7 i+ d4 O# ]+ x2 afront-end, mobile (native and hybrid) platforms, and back-end. It is crucial for JavaScript # _" t; ]$ y" x1 S' H% F( qdevelopers to understand how data structures work and how to design algorithms to 1 l8 \8 J- o3 L7 m8 \$ o, ibuild applications.0 b- Y: ^8 [, s) N) T: F- J# W3 G
Therefore, this book aims to teach data structure and algorithm concepts from ; i1 t+ D0 Y) S6 O! Xcomputer science for JavaScript rather than for the more typical Java or C++. Because 0 [3 z8 j2 i K) c: DJavaScript follows the prototypal inheritance pattern, unlike Java and C++ (which follow- |$ K3 g/ n9 p5 a3 ^' v
the inheritance pattern), there are some changes in writing data structures in JavaScript.! b x7 r0 L7 D+ c
The classical inheritance pattern allows inheritance by creating a blueprint-like! ?8 u: B7 z9 y( }* P
form 7 Y: n& A1 a1 b: ?# g9 `that objects follow during inheritance. However, the prototypal inheritance pattern " L K. @4 o# O1 M6 Umeans copying the objects and changing their properties. ) T9 R, `# }# \. w: h+ Q1 ]This book first covers fundamental mathematics for Big-O analysis and then lays out+ J# `9 M+ E1 O8 |
the basic JavaScript foundations, such as primitive objects and types. Then, this book P2 l: Q3 u- T. X& }
covers implementations and algorithms for fundamental data structures such as linked * ~. n {, N7 r! R! j% {3 c/ rlists, stacks, trees, heaps, and graphs. Finally, more advanced topics such as efficient3 F K" G! `. L- Y: X
string search algorithms, caching algorithms, and dynamic programming problems are( }( z) e/ N9 [& V9 l
explored in great detail.2 [/ ]+ Q o! g+ O( S# n' |- v
( r- i4 L s2 W$ Y( w
2 F% D1 A5 z9 ?3 R: w7 M