We know that elements in an array list are stored in contiguous manner and elements in linked list are stored in non-contiguous manner. Is there any way to prove it? I mean any piece of code, through which we are able to show this behavior of array list and linked list.