3 ms·
While there's a certain use for linked lists - in operating systems kernels for example and as a programmer you absolutely have to know how linked lists work, t
by DeathArrow 4y ago
While there's a certain use for linked lists - in operating systems kernels for example and as a programmer you absolutely have to know how linked lists work, there are other linear data structures which are more suited for general programming.
To give a C# example, arrays, lists and dictionaries (hash tables) implement iterators so you can always know what the next element in collection is. Elements can be accessed by key or index in O(1),elements can be added in O(1). The case in which you absolutely have to insert an element in a particular position is rare so linked lists are seldom used.
The same case is for C++, there is a vector class in STL but no linked list class. Same for Java.
- selimco 4y ago> The same case is for C++, there is a vector class in STL but no linked list class. Same for Java. Java does have a linked list in the standard library: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/LinkedList.html https://docs.oracle.com/en/java/javase/17/docs/api/java.base...
- cyber_kinetist 4y ago> The same case is for C++, there is a vector class in STL but no linked list class. No, there is std::list. https://en.cppreference.com/w/cpp/container/list https://en.cppreference.com/w/cpp/container/list > Same for Java. Also no, LinkedList exists. https://docs.oracle.com/javase/7/docs/api/java/util/LinkedList.html https://docs.oracle.com/javase/7/docs/api/java/util/LinkedLi...