Wednesday, December 4, 2019

What is the difference between Linked List and Arrays ?

Well in my perspective linked lists have a pointer that points to the next element and if you are searching for a specific element in the middle or the end you have to start from the beginning and srarch.

In Arrays you can easily access the elements  by writing the array name and putting the index that you want and you will access it

In some languages arrays have a limited size but the linked lists are dynamic.

Elements in the array are stored consecutively  not as linked lists they are stored randomly.

No comments:

Post a Comment