Data Structure(2)

Hyerang Kim·2020년 5월 24일
0

Set

Collection of data elements like list or array.

  • Unordered
  • Elements are not stored by insertion (unexpected order)
  • Mutable
  • Duplicate entries are not possible
# No Duplicate values -> not working
x = set(['wecode','wework','wecode'])
# Non-duplicate value can be added -> working
x.add('weplay')
# Another duplicates -> not working
x.add('weplay')
  • It's for fast lookup

Structure of hash

  • Elements are not stored in order in hash
profile
Backend Developer

0개의 댓글