17 September 2010

Lined Lists vs Array Lists, a quick view

Alsalamo Alykom,

Lists in many programming languages are implemented in many ways such as linked lists, Array Lists.http://www.blogger.com/img/blank.gif

Linked lists are about nodes being linked together, and It may be single or doubly linked lists.
the insertion and deletion operations are simply done by changing the destination of some pointers. But the search is liner!.

In Array list, the Array Lists is used technique called dynamic-arrays, in which these lists is built based on arrays.
Also, you can still insert and remove elements from ArrayLists such as you done with Lined Lists, but this operation uses shifting operation as an underlying operation.
For example, in Java, java.uitl.ArrayList class uses System.arraycopy to do the shift of elements.
ArrayLists is very efficient in Random access.

thanks all folks!
Post a Comment