Compute polynomial, Cn.x^n + Cn-1.x^(n-1) + … … + C2.x^2 + C1.x + C0
June 12, 2012
Non-leaf nodes of a binary tree
June 12, 2012

Difference between linked list and Arrays

Differences:

Array is an indexed collection of elements. i.e arr[i] represents elements at i‘th index in the array arr. Linked list’s element cannot be accessed using index, rather you have to traverse to that particular element.

Hence, accessing i‘th element in the array is constant-time operation (memory look-up) while accessing i‘th element in a linked list requires i steps (moving to the i‘th node) and is hence O(i) time operation.

Next: Storage …

1 Comment

  1. anuj says:

    why we can not use binary search in linked list even it is sorted,what is main reason behind this fact?

Leave a Reply

Your email address will not be published. Required fields are marked *