Write a method that will return a string indicating whether or not the double value
is in doubleSet
. For example if dSet
contained {4.5,...
Search Results
Individual Exercises
A teacher is using a set to track the names of the students in their class. However, some students have decided to drop the class. Write...
The set passed in as a parameter contains all integer values from 1 to 50 (inclusive--so 1 and 50 are both in the set). Remove all even...
Sometimes, rather than remove a single item we may want to remove many items with a single method call. The method below takes in a set...
The method below takes in two sets of integer values called setA
and setB
. Create a new set of integers, then add any value that is in...
The method below takes in a map of integer key/value pairs. Create a new map and add each key from the original map into the new map,...
The method below takes in a set of String names of students. Below, use this set names
to create a map (either HashMap or TreeMap is...
A teacher is tracking grades for two sections of a class using two maps. Each map uses the student's name as a key with their grade is...
In the previous exercise, you took two maps and turned them into one larger map. Now the teacher wants to take that larger map and create...
The method below takes in two integers as parameters and should throw an IllegalArgumentException
if either parameter is the number 5. In...
The method below takes an array of Jeroos and should throw an exception if any Jeroo in the array is null
or if any is facing North.
In...
The method below takes in a String parameter representing a username. It should throw an Exception
if the username is less than 3...
The method divideValues()
will throw an IllegalArgumentException
if either parameter is 5. The method below takes two integer values as...
The validateJeroo()
method takes in an array of Jeroo objects and could throw two different exceptions.
If a Jeroo in the array is null,...
The following code runs a method called validateUser()
that will throw an IllegalArgumentException
if a username (passed in as a...
A graph with relatively few edges is called:
A graph with many edges is called:
A graph that does not have a path of length 3 or more that connects a node v to itself is:
A directed graph is one
A complete graph is one which each pair of vertices:
A DAG is:
The sequence of vertices v1...vn with edges connecting all the vertices is called:
Trees and lists are special cases of graphs.
Based on the adjacency matrix shown below, which of the following statements is true:
The adjacency matrix shown below is an accurate representation of the graph shown below.