Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Posts
    47
    Rep Power
    0

    Default What does : Access to any element of an ArrayList is O(1). mean?

    can anybody please explain this further,........Access to any element of an ArrayList is O(1). What? So what is the correct syntax? What would I type to print the element? System.out.println(object.name(index(index));?

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    786
    Rep Power
    5

    Default Re: What does : Access to any element of an ArrayList is O(1). mean?

    Behind an ArrayList is just a normal array. Access to an element of the array is O (1) because you can access directly the element (no loop or something)!
    To print the element -> System.out.print(listname.get(index))

    http://en.wikipedia.org/wiki/O_notation

Similar Threads

  1. ArrayList remove an element from the list
    By ralf in forum New To Java
    Replies: 37
    Last Post: 07-12-2011, 07:08 PM
  2. Replies: 12
    Last Post: 07-07-2011, 08:49 PM
  3. Replies: 1
    Last Post: 05-20-2010, 10:17 PM
  4. [SOLVED] ArrayList element to int
    By grahamb314 in forum New To Java
    Replies: 9
    Last Post: 11-22-2008, 05:09 PM
  5. How to access element in a CSV?
    By venkatteshb in forum New To Java
    Replies: 11
    Last Post: 08-17-2008, 11:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •