VB.Net | When should I use a List vs a LinkedList?

Here, we are going to learn when should I use a List vs a LinkedList in VB.Net?
Submitted by Nidhi, on December 23, 2020

List<T> and LinkedList<T> are data structures, both are used to store data elements. The List data structure uses the system array-like Object[] to store the data elements. We can increase the size of the list when we needed. Whereas Linked List stores the data in the form of nodes, A node contains two parts data and pointer. The data part is used to store the item, and the pointer part stores the address of the next node.

The execution of LinkedList<T> is slower than a list. The LinkedList<T> is efficient only when we sequentially access data items. It is more expensive when we access the item randomly. Because we need to walk from start to end of the linked list to search the item.

The implementation of List in the .NET framework using an array that's why it is faster in a random search.

Comments and Discussions

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.