Our great sponsors
-
javascript-algorithms
📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Traditionally, a linked list allows you to insert before/after a node. i.e. addBefore(node,value) (see [2] ) He doesn't implement addBefore & addAfter.
Instead, he provides a whole bunch of non-canonical helpers like reverse(), toArray(), deleteTail() etc - these are typical LC-Easy problems that don't belong inside the data structure.
My own introduction to these things was a C course called "Data Structures in C" in the traditional CS curriculum, and yes, you would have to malloc a new node, get back a pointer with a memory address, & the process of pointing the next pointer of the current node to this new node so that the memory address of the next value was explicitly "linked" to the current value and hence linked list etc...I guess much of that terminology is lost on the new generation in the absence of pointers & memory addresses.
The canonical exercise in those days was - Show that a linked list does not store objects in contiguous memory, unlike an array. So to solve this, you would traverse the list from the head node & print the actual addresses of the memory locations along the way, proving that the vals aren't stored contiguously. I wonder what that exercise would mean in JS land.
That said, yeah its a good starting point & I applaud the effort.
[1]https://github.com/trekhleb/javascript-algorithms/blob/maste...
Another useful resource is Functional Jargon Explained (in Javascript): https://github.com/hemanth/functional-programming-jargon
Related posts
- Lodash just declared issue bankruptcy and closed every issue and open PR
- Ramda: A practical functional library for JavaScript programmers
- Discovered a 63kb tiddlywiki like self saving HTML+JS wiki and its looking cool
- 10 JavaScript and NodeJS Tips that Will Knock Away Multiple Concepts
- TypeScript Design Tokens with Styled Components