+ 1

Who can Explain for me arraylist and linklist ?

https://code.sololearn.com/WMjtqfL1x8gU/?ref=app

4th Dec 2017, 11:22 PM
Boulaïd Boudada
Boulaïd Boudada - avatar
2 Respuestas
+ 2
Hello, bro Strictly speaking, a linked list and an array are different data structures that are not tied to a specific programming language. Array: An array is a collection of the same type of data located continuously in memory. Access to the element is carried out by the index for O (1) - we are addressing directly to the desired memory location. Related list: Access to the item in the linked list takes O (N) on average by searching for items in the search for the desired one. The methods of accessing elements differ in their implementation and in the programming language. For example, in Java in the standard LinkedList class, depending on the situation, the elements can be traversed either from the beginning or from the end of the list. And the search for an element can be carried out both by index and by comparison of elements. A coherent list requires large memory costs, all other things being equal, by storing pointers to the next / previous elements and the features of the internal implementation. Hope this help for you!
4th Dec 2017, 11:50 PM
stKhaDgar
stKhaDgar - avatar
+ 1
thanks bro
4th Dec 2017, 11:52 PM
Boulaïd Boudada
Boulaïd Boudada - avatar