Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Specifications: Write a Java program that prompts the user to enter two lines of words. The words are separated by spaces. Extract the words

Problem Specifications:

Write a Java program that prompts the user to enter two lines of words. The words are separated by spaces. Extract the words from the two lines into two lists. Write the following methods that do the:

1- Display the union of the two lists in ascending alphabetical order using quick sort.

2- Display the difference of the two lists in descending alphabetical order using merge sort.

3- Display the intersection of the two lists in ascending alphabetical order using quick sort.

4- Recursively display the number of vowel letters in each list. The letters for vowels are A, E, I, O, and U.

5- Display a menu of six options: insert two lists, display the union, display the difference, display the intersection, display the vowel letters, and end program.

Find the time complexity of the above five methods. Write the Bio-O notation as a comment next to each method. Use ^ to represent the power sign (Example N3 = N^3)

Here is a sample of an output:

Line 1: red green blue yellow purple cyan orange

Line 2: red black brown cyan orange pink

The union is [black, blue, brown, cyan, cyan, green, orange, orange, pink, purple, red, red, yellow]

The difference is [blue, green, purple, yellow]

The intersection is [cyan, orange, red]

The number of vowels in the first line is: 13

The number of vowels in the second line is: 8

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

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

What is job enlargement ?

Answered: 1 week ago

Question

what is the most common cause of preterm birth in twin pregnancies?

Answered: 1 week ago

Question

Which diagnostic test is most commonly used to confirm PROM?

Answered: 1 week ago

Question

What is the hallmark clinical feature of a molar pregnancy?

Answered: 1 week ago

Question

How did you feel about taking piano lessons as a child? (general)

Answered: 1 week ago