[Solved] CSE 241-Homework 7- a generic class hierarchy for sets and maps for Java

30 $

File Name: CSE_241-Homework_7-_a_generic_class_hierarchy_for_sets_and_maps_for_Java.zip
File Size: 678.24 KB

SKU: [Solved] CSE 241-Homework 7- a generic class hierarchy for sets and maps for Java Category: Tag:

Or Upload Your Assignment Here:


Homework # 7

In this homework, you will write a generic class hierarchy for sets and maps for Java.

GTUSetInt<T> is a Java interface with the following methods.

empty
Test whether container is empty
size
Return container size
max_size
Return maximum size
insert
Insert element, throws exception InvalidParameterException if the element is already in the set
intersection

The returned set is the intersection of this set and the given set.

erase
Erase element
clear
Clear all content
find
Get iterator to element
count
Count elements with a specific value
begin
Return iterator to beginning
end
Return iterator to end

The class GTUSet<T> implements the GTUSetInt interface. It will keep its data using Java arrays. Do not use any Java Collection classes. It implements the intersection method as follows:

intersection
GTUSetInt<T> intersection(GTUSetInt<T>)

The returned set is the intersection of this set and the given set.

The class GTUMap<K, V> extends from GTUSet< javafx.util.Pair <K, V> > and implements the following extra method

at
Access element
V at(K k) If k matches the key of an element in the set, the method returns a reference to its mapped value.

The class GTUIterator implements the following methods

Write your driver class to test the all the classes and all of their methods.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CSE 241-Homework 7- a generic class hierarchy for sets and maps for Java
30 $