• Home
  • Space
  • More options


Performance matrix
  • O(1) - For performing an operation required constant number of steps (e.g., 1, 5, 10 or another number), and this number does not depend on the amount of input data.
  • O(log(N)) - To perform an operation on the N elements are necessary number of steps of the order of log (N), wherein the base of the logarithm is the most commonly 2.
  • O(N) - To perform an operation on N elements needed approximately as many steps as are the elements.

structure

add

search

delete

Index access

Array

O(N)

O(N)

O(N)

О(1)

LinkedList

О(1)

O(N)

O(N)

O(N)

ArrayList

О(1)

O(N)

O(N)

O(1)

Stack

О(1)

-

О(1)

-

Queue

О(1)

-

О(1)

-

HashMap

О(1)

О(1)

О(1)

-

TreeMap

О(log(N))

О(log(N))

О(log(N))

-

HashSet

О(1)

О(1)

О(1)

-

TreeSet

О(log(N))

О(log(N))

О(log(N))

-