Skip to content
loading...

re: Data Structures & Algorithms in JavaScript(Single Linked List) Part 1 VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Yes, you can get rid of the function and simply use a trailing pointer, But loop until the desired index is common in linked list methods, so inste...
 

Your insert calls this.getElementAt to get the previous, that is not O(1).

That trailing pointer can make the difference between serving a response and not serving anything in a production setting ;) Every cycle counts, even on 32 cores and 128GB of RAM...

code of conduct - report abuse