Using this class definition:
public class node<E> { //... instance variables public node(E d, node<E> n) { this.data = d;...
Searching for: int
Using this class definition:
public class node<E> { //... instance variables public node(E d, node<E> n) { this.data = d;...
Using this class definition:
public class node<E> { //... instance variables public node(E d, node<E> n) { this.data = d;...
The following method takes in a list of generic objects and returns the number of items in the list. As written, however, the method will...
We have a program that keeps track of the hours someone sleeps each night, with an array of seven integers that represent each day of the...
The function maximize
receives two integers and updates them so that they both hold the value of the greater of the two. It also helps...
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...
Write a recursive function called add_digits
that will receive a positive number and returns the sum of each of digits. For example,...
Write a recursive function called half_left
that will receive a measurement of the amount of a chemical that is decaying. The amount will...
Write a recursive function called is_increasing
that will receive a vector of integers called list and determine whether or not it is...
Complete the following binary search method on integers. Find the number search
in the array numbers
. Return the index of the element if...
Complete the following linear search method. Find the number search
in the array numbers
. If the number is found, return the index for...
Complete the following contains
method so it returns true
if the value being searched is found in the array, or false
otherwise. You must...
Complete the following linear search method. Find the number search
in the array numbers
. If the number is found, return the index for...
Given an array containing three ints, return the sum of all the elements. It is safe to assume that the array always has at least 3...
This method accepts two integer arrays as its parameters and returns a new array, which contains all of the elements of first parameter...
Create a print line that sums variable a and variable b.
Given an array of integers, return the largest value in the array. Assume the array has only posivitive numbers. If the array is empty,...
Given an array of int
s, return the smallest value in the array. Assume the array has only posivitive numbers. If the array has no values...
For this question assume the following implementation of LinkedList and Node:
public class LinkedList<T> implements ListInterface...
For the question below, assume the following implementation of a Person class:
public class Person { private int age; private String...
For the question below, assume the following implementation of a Person class:
public class Person { private int age; private String...
For the question below, assume the following implementation of a Person class:
public class Person { private int age; private String...
For the question below, assume the following implementation of an Employee class:
class Employee { String name; public Employee(String ...
Write a method that takes as argument an integer size
and returns an integer array of that size. The method should allocate a new array...
The image below shows a binary tree. Which of the options below include only internal nodes?