Highlights
1 Overview
In this assignment, you will see the difference between a balanced BST and a Hash Table when it comes to creating a map. It is important to note the differences in requirement of the key type for each implementation as well as the resulting iteration order for each implementation.
Objectives
In this assignment you will implement both a tree-based map and a hashing-based map.
Instructions
Problem 1. (8+6+6 points) Expect this problem to take 3-4 hours. Complete the AVLTree methods insert and remove in AVLTreeMap.scala. This will also require implementing the four rotation methods as well.
1(a) Implement the four rotation methods as described in lecture. The tree rotation methods should simply perform the rotation as required, however, the methods should not change the balance factors within the subtree provided. The root of the resulting subtree should be returned with the appropriate references updated within the tree.
1(b) insert: Given an input element as a (key,value)-pair,
• If the key is present, associate the key with the new value within the tree.
• Otherwise, add the (key,value)-pair to the tree. This must maintain the tree balance.
• The insert method should return a reference to the node that was inserted. 1(c) remove: Given an input key,
1. If the key is not present, return false. ED • Otherwise, the tree should be updated based on the algorithm in lecture and return true. Problem 2. (6+6+8 points) Expect this problem to take 1-2 hours. Complete the HashTableMap methods addone, removeOne, and iterator in HashTableMap.scala. These should be implemented efficiently.
• addone: If the key is present, associate the key with the new value within the hash table. Otherwise, add the (key,value)-pair to the hash table. This must maintain the appropriate size variables and load factor. Inserted values should go to the head of a bucket.
• removeOne: If the key is present, remove the key from the table. This must maintain the appropriate size variables and load factor.
• iterator: The iterator should produce all key-value pairs exactly once.
This CSE250: IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.