What are some issues that should be taken into account when considering using a linked list versus another data structure?
The best reward you get with linkedlist is that insertion is an O(1) operation on both the ends with the fact that the list can expand exactly as per your size requirements whenever you want, which is not the case with some data structures, where size need to be mentioned at the time of creation..
however, Linked Lists are not ideal solution for the cases, where insertion in between list needs to be done, Or data needs to be accessed in between the list, Because the LinkedList do not allow random access, which means, We need to start from head and find our node, due to which insertion/removal in mid becomes an O(N) operation..
Get Answers For Free
Most questions answered within 1 hours.