# Search Results

Searching for: mod

## Individual Exercises

0 / 50

Write a function in Java that implements the following logic: Given a non-negative number num, return true if num is within 2 of a...

0 / 50

Write a function in Java that takes an int array as its parameter and returns the number of even ints it contains. Note: the % "mod"...

0 / 50

Given an array of int values, return true if the array contains either 3 even or 3 odd values all next to each other.

0 / 50

For each multiple of 10 in the given array, change all the values following it to be that multiple of 10, until encountering another...

0 / 50

We want make a package of goal kilos of chocolate. We have small bars (1 kilo each) and big bars (5 kilos each). Return the number of...

0 / 50

Given a non-negative int n, return the sum of its digits recursively (no loops). Note that mod (%) by 10 yields the rightmost digit (126...

0 / 50

Given a non-negative int n, compute recursively (no loops) the count of the occurrences of 8 as a digit, except that an 8 with another 8...

0 / 50

Given a non-negative int n, return the count of the occurrences of 7 as a digit, so for example 717 yields 2. (no loops). Note that mod (...

0 / 10

Write a recursive function BSTsmallcount that, given a BST and a value key, returns the number of nodes having values less than key. Your...

0 / 10

Write a recursive function BSTsmallcount that, given a BST and a value key, returns the number of nodes having values less than key. Your...

0 / 10

Given a binary tree, check if the tree satisfies the property that for each node, the sum of the values of its left and right children...

0 / 10

Write a recursive function that returns true if there is a node in the given binary tree with the given value, and false otherwise. Note...

0 / 10

Given a binary tree, write a recursive function to return the difference between the sum of all node values at odd levels and sum of all...

0 / 10

The height of a binary tree is the length of the path to the deepest node. An empty tree has a height of 0, a tree with one node has a...

0 / 10

Write a recursive function that increments by one the value for every node in the binary tree pointed at by root, then returns the...

0 / 10

Write a recursive function to count the number of leaf nodes in the binary tree pointed at by root. You must use the isLeaf method to...

0 / 10

We define a "root-to-leaf path" to be any sequence of nodes in a tree starting with the root node and proceeding downward to a leaf. The...

0 / 10

Write a recursive function to set the value for each node in a binary tree to be its depth then return the modified tree. Assume that...

0 / 10

Write a recursive function that returns the sum of the values for all of the nodes of the binary tree with root root.
Here are methods...

0 / 10

Given two binary trees, return true if and only if they are mirror images of each other. Note that two empty trees are considered mirror...

0 / 10

Given two binary trees, return true if they are identical (they have nodes with the same values, arranged in the same way).
Here are...

0 / 10

Given two binary trees, return true if and only if they are structurally identical (they have the same shape, but their nodes can have...

0 / 50

For this question assume the following implementations of Computer, Tablet, and Notebook

public class Computer { private String...