Time complexity of ArrayList in Java
2015-03-27 11:50
274 查看
The size, isEmpty, get, set, iterator, and listIterator operations run in constant time. The add operation runs in amortized constant time, that is, adding n elements requires O(n) time. All of the other operations run in linear time (roughly speaking). The constant factor is low compared to that for the LinkedList implementation.
Basically ArrayList is implemented by an Array.
Reference:
Official API
StackOverflow
Basically ArrayList is implemented by an Array.
Reference:
Official API
StackOverflow
相关文章推荐
- what is time complexity of concatenating two int in java example
- java.lang.RuntimeException: Date pattern must be set for column update_time in the schema of component
- Java in Science: Data Interpolation and Extrapolation Using Numerical Methods of Polynomial Fittings
- Web Tier to Go With Java EE 5: Summary of New Features in JavaServer Faces 1.2 Technology
- Domain-Driven Design: Tackling Complexity in the Heart of Software
- How to get control of your time and your life (Alan Lakein.)
- nested exception is java.sql.SQLException: Unknown type '246 in column 1 of 3 in binary-encoded result set. 问题
- Fix a Man-made Mistake in Java Project of Eclipse
- Designing and Engineering Time: The Psychology of Time Perception in Software
- Borland获得Java Just-In-Time编译程序的专利权
- Fix the problem: java.lang.OutOfMemoryError: PermGen space in Java development
- Elements of ArrayList of java, cloned, not reference
- Web Tier to Go With Java EE 5: Summary of New Features in Java Standard Tag Library (JSTL) 1.2
- Some Samples Of Oracle Function In Order To Relax Java Program.
- Easy Deployment of Real-Time Java for Linux
- Summary on 20080616: Basic usage of Enum in Java1.5
- Think in patten of Java中的一道习题
- Memory space manipulating in Java(Section three:Basic Knowledge of Java Process Heap )
- Process of creating an object in Java
- Concurrent and Real-Time Programming in Java