Java Arraylist And Hashmap Complexity Theory