Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1)Write a method public static void downsize(LinkedList employeeNames, int n) that removes every nth employee from a linked list. 2)Implement the sieve of Eratosthenes :

1)Write a method

public static void downsize(LinkedList employeeNames, int n)

that removes every nth employee from a linked list.

2)Implement the sieve of Eratosthenes: a method for computing prime numbers, known to the ancient Greeks. This method will compute all prime numbers up to n.

Choose an n. First insert all numbers from 2 to n into a set. Then erase all multiples of 2 (except 2); that is, 4, 6, 8, 10, 12, . . . . Erase all multiples of 3; that is, 6, 9, 12, 15, . . . . Go up to ?n. Then print the set.

3)Write a program that keeps a map in which both keys and values are stringsthe names of students and their course grades. Prompt the user of the program to add or remove students, to modify grades, or to print all grades. The printout should be sorted by name and formatted like this:

Carl: B+ Joe: C Sarah: A

4)Insert all words from a large file (such as the novel War and Peace) into a hash set and a tree set. Time the results. Which data structure is more efficient?

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

Neo4j Data Modeling

Authors: Steve Hoberman ,David Fauth

1st Edition

1634621913, 978-1634621915

More Books

Students also viewed these Databases questions