CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • jgeorge

    MemberDec 18, 2011

    imgopi
    Help!!!
    Friends i want to know the exact difference between Arraya
    and Linked Arrays in java.They both look like same in functionalists,but what is the main difference.Any one know the exact answer please provide it.
    arrays cannot be expanded or increased so we use linked list for dynamic data storage

    For example::
    We want to delete some elements from array then either we have to place zero or we need to rearrange it.
    For dynamic deletion and insertion linked list is used instead arrays.
    But if we do not need these operations then using arrays is sufficient and easier too.
    Are you sure? This action cannot be undone.
    Cancel
  • jgeorge

    MemberDec 18, 2011

    imgopi
    Help!!!
    Friends i want to know the exact difference between Arraya
    and Linked Arrays in java.They both look like same in functionalists,but what is the main difference.Any one know the exact answer please provide it.
    posted Friday, August 11, 2006 1:34 PM [​IMG]
    [​IMG]
    [​IMG]
    Originally posted by pawar santosh:​
    Can anybody tell me exact difference between Linked List and Array List.​
    Please give Example By Usage of Both in JavaCode.​
    Thanks in Advance.​


    Well Gopi,
    The biggest difference between is

    Linked Arrays are meant for sequential accessing. ArrayList are meant for random accessing.

    Although you can check out the books on Collections for time being I can tell you.

    An Array is a "special" object in Java that has very few methods. You can access the value in the array the [ ] brackets, and you can determine the length (the .length) property, and thats about the extent of the Array. The array has a FIXED size that cannot be changed.

    The ArrayList is part of the Collections Framework. It is a List that is built on top of an array. It provides methods to add to the list (thereby changing the size), as well as to obtain an iterator, and to remove elements, sort elements, and perform searches. Basically, it saves you from having to write that code when using an array.

    The LinkedList is also a List. It essentially provides the same methods as the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html" target="_blank" rel="nofollow noopener noreferrer">ArrayList (Java Platform SE 7 )</a>, except the underlying data structure uses objects that contain references to other objects to form a list. This is "similar" to the concept other languages call "pointers" (but not quite the same).


    I hope I make it clear.
    Are you sure? This action cannot be undone.
    Cancel
  • vinci

    MemberDec 18, 2011

    array is the homogeneous collection of elements in continuous memory space while linked list is the collection of elements in links.Also array contains reference while linked list doesnt.
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberDec 19, 2011

    Arrays can hold only a single data format. In case of Linked Lists, it can hold any kind of data and traversal and ordering are easy in Linked List. 😀
    Are you sure? This action cannot be undone.
    Cancel
  • imgopi

    MemberDec 19, 2011

    jgeorge
    posted Friday, August 11, 2006 1:34 PM [​IMG]
    [​IMG]
    [​IMG]
    Originally posted by pawar santosh:​
    Can anybody tell me exact difference between Linked List and Array List.​
    Please give Example By Usage of Both in JavaCode.​
    Thanks in Advance.​


    Well Gopi,
    The biggest difference between is

    Linked Arrays are meant for sequential accessing. ArrayList are meant for random accessing.

    Although you can check out the books on Collections for time being I can tell you.

    An Array is a "special" object in Java that has very few methods. You can access the value in the array the [ ] brackets, and you can determine the length (the .length) property, and thats about the extent of the Array. The array has a FIXED size that cannot be changed.

    The ArrayList is part of the Collections Framework. It is a List that is built on top of an array. It provides methods to add to the list (thereby changing the size), as well as to obtain an iterator, and to remove elements, sort elements, and perform searches. Basically, it saves you from having to write that code when using an array.

    The LinkedList is also a List. It essentially provides the same methods as the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html" target="_blank" rel="nofollow noopener noreferrer">ArrayList (Java Platform SE 7 )</a>, except the underlying data structure uses objects that contain references to other objects to form a list. This is "similar" to the concept other languages call "pointers" (but not quite the same).


    I hope I make it clear.
    First thanks friend for giving response and I am clear about it,but am expecting some more in the form of logical manner.
    Are you sure? This action cannot be undone.
    Cancel
  • manishks

    MemberDec 19, 2011

    yes it is easy to traverse a linked list rather than array....for array we need consecutive memory locations...but thats not the case with linked list.....😀
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register