A LinkedList is a very basic data structure and is commonly used to solve many computer science problems. In the old world, various operating systems' file management software was based on LinkedList.
So far, we've learned how to create a LinkedList and expose APIs to do operations on it. This is the best time to summarize the complexity of it compared to other discussed data structures such as arrays or vectors. We should choose LinkedList over arrays or vectors when we need more insertion or deletion operations compared to fetch (index) operation. If we need more fetch (index) operations, we should choose arrays or vectors over a LinkedList. This conclusion isn't final though. We should still consider space complexity. If space is more of a concern to us than time, then arrays or vectors always beat a LinkedList.
Now a query may arise, that, if we have...