We are only going to focus on singly linked list for this article. We are going to implement linked list in JavaScript and go over some algorithms with the linked list. Elements in an array are stored contiguously in memory while linked lists are stored as nodes with two fields: current value and a pointer to the next thing in the list. Linked list is like an array but more flexible. For this article, we are going to look at the Linked List. As JavaScript is becoming a more mainstream general purpose language and web developers are expected to have a strong foundation in computer science to be able to write increasingly complex code, it’s worth looking at how those CS 101 data structures and algorithms are implemented in JavaScript. My university algorithms and data structures course was taught in Java. JavaScript is not the language of choice to teach computer science, at least when I was in school.
0 Comments
Leave a Reply. |