Question: in java and add comments: Note: don't use collections, like list, HashSet (TreeSet), and HashMap (TreeMap) Code that implements a set of items (strings) using

in java and add comments:

Note: don't use collections, like list, HashSet (TreeSet), and HashMap (TreeMap)

Code that implements a set of items (strings) using a singly linked list. A set is a collection of items in which no item occurs more than once. code should externally support the following functions (the ones i'm stuck on):

  1. Return the number of items in the set. (Iterative Solution on geeksforgeeks is what i was thinking)
  2. Determine if an item is a member of the set.
  3. Return a reference to a specific node in the set (given an item)
  4. Determine the union (i.e. set of all distinctelements) and the intersection (i.e. set of all common distinctelements) of two sets.
  • Include appropriate JUnit tests. (no main method)
  • Count the time it takes to execute each of the above operations. Note: To count the time use system.currentTimeMillis().

Step by Step Solution

3.46 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

class Node String data Node next public NodeString data thisdata data thisnext null public class Lin... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!