i dont really see a use case for linked lists in a language like JS. In C/C++ you can't dynamically expand an array like you can in JS, so there is a use case there, but JS is more flexible and the cost of access is really high, so you're probably better off with JS alternatives like a simple array.
I'm curious what kind of use case exists for linked lists in JS :)
When you want to insert n delete from the beginning of a large array; it will be better to make use of a linked list instead because insertion n deletion from the beginning happen in constant time O(1) as compare to arrays which is O(n)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
i dont really see a use case for linked lists in a language like JS. In C/C++ you can't dynamically expand an array like you can in JS, so there is a use case there, but JS is more flexible and the cost of access is really high, so you're probably better off with JS alternatives like a simple array.
I'm curious what kind of use case exists for linked lists in JS :)
When you want to insert n delete from the beginning of a large array; it will be better to make use of a linked list instead because insertion n deletion from the beginning happen in constant time O(1) as compare to arrays which is O(n)