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

Popular posts from this blog

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

clojure - 'get' replacement that throws exception on not found? -