Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I got no idea what to do but I really wish to learn from this, so please make it as newbie friendly as possible because

I got no idea what to do but I really wish to learn from this, so please make it as newbie friendly as possible because I really want to use this knowledge on my future programs. Thanks a lot!

Write a Java class that stores a data set of strings consisting only of numbers (0 9) and English letters (both lower and upper cases). Your class needs to implement the following dictionary functions.

Two constructor methods/functions

1. One that does not have any parameter and initializes the data set as empty set

2. One that takes a parameter consisting of a set of strings and initialize the data set with those strings.

Int search(string s)

This function returns the number of copies of string s in the data set, or 0 if the data set does not contain the string s.

void add(String s)

This function adds a copy of the string s to the data set.

void remove(String s)

This function removes a copy of the string s from the data set or does nothing if the data set does not contain the string s.

void print()

This function prints all strings in the data set (in no particular order). In case there are identical string in the data set all copies of the string contained in the data set will be printed.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions