Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

class Node String data Node next public NodeString data thisdata data thisnext null public class Lin... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Programming questions

Question

How do classes relate to objects?

Answered: 1 week ago

Question

What is locking and what does it accomplish?

Answered: 1 week ago