Originally Posted by
copeg
Not sure why you wish to reinvent the wheel, but a HashMap is a LOT more complicated than creates Lists of Lists...it should utilize a hash function, buckets, and ways to expand the buckets - all together providing constant time look-up performance (as opposed to linear time look-up performance relying on looping over an ArrayList to find an element). My .02
Because my teacher wants us to code our own code which means we can't use java's api other than arraylist. we had to make our own arraylist class from array. and i get that, i'm just making a simple hashmap to store keys and values and use %m to find the keys or horner's method. then use either quick sort or merge sort to find the keys. appreciate your .02, i wish we didn't have to reinent the wheels