java – Array ArrayList python equivalent

java – Array ArrayList python equivalent

ArrayList in java and list in python are both dynamic arrays. They both have O(1) average indexing time and O(1) average adding an element to the end time.

Array in java is not tuple in python. While it is true that you cannot add elements to both data structures. Python tuple does not support assignment, that is you cannot reassign individual elements in a tuple, while you can in java Array.

  • Javas ArrayList is similar to Pythons List.
  • Nicer than Array for adding and removing items.
  • Javas Array has fixed length like you
    mentioned.
  • Not sure what its equivalent in Python would be.

java – Array ArrayList python equivalent

Leave a Reply

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