|Written by Ian Elliot|
|Thursday, 05 September 2019|
Page 4 of 4
When To Use a List
Linked lists are generally good at representing data when the fundamental operations are insertion or deletion at the start or end. In this sense they are very like the stack - indeed you can use a linked list to implement a stack. However they are also very good at inserting and deleting elements in the middle of the list. What they are not so good at is finding an element or finding the fifth, sixth or nth element. They are basically sequential access data structures.
The complete code for the List constructor is:
Just jQuery The Core UI - Forms