Scala Custom Data Structures & Optimization -
am new scala... wondering how create / design data structure supports these features:
• constructor takes used size:
datasize: int
• accessor method:
def get(key: k): option[v]
• setter / put "data structure" method:
def put(key: k, value: v): unit
• bigo(1) of used keys;
bigo(datasize) = bigo(1)
• bigo(log n) of key
• bigo(log n) put of key
any advice beneficial...
use scala.collection.mutable.map
.
Comments
Post a Comment