Set

A collection of objects that does not allow duplicates unlike Arrays that do allow duplicate

insert(element):

  • Θ(1)
    remove(element):
  • Θ(1)
    contains(index):
  • 𝑂(𝑛)
    allAll(set):
  • Θ(𝑚)
    union(set):
  • 𝑂(𝑛 +𝑚)
    removeAll(set):
  • Θ(1)
    intersection(set):
  • 𝑂(𝑛 +𝑚)

Ordered Sets

A set with defined orders, all pairs are greater than or lesser than other pairs

Contains all set operations with
findMin():

  • Θ(1)
    findMax():
  • Θ(1)