Computer Science Homework Solutions
Problem
#92380

Write an algorithm, using pseudo code, to perform the following task: Given a string of numbers, identify all of the substrings that form numbers that are divisible by 3. For example, applying the algorithm on the string 37540 should produce the following substrings (not necessarily in this order): 0; 3; 75; 54; 375; 540

1.Write an algorithm, using pseudo code, to perform one of the following tasks,* Given a string of numbers, identify all of the substrings that form numbers that are divisible by 3. For example, applying the algorithm on the string 37540 should produce the following substrings  (not necessarily in this order): 0; 3; 75; 54; 375; 540

2.Four prospectors with only one lantern must walk through a mineshaft.  At most, two prospectors can travel together and any prospector in the shaft must be with the lantern.  The prospectors, named Andrews, Blake, Johnson, and Kelly, can walk through the shaft in one minute, two minutes, four minutes, and eight minutes, respectively.  When two walk together they travel at the speed of the slower prospector.  How can the prospectors get through the mineshaft in only 15 minutes?  After you have solved this problem, explain how you got your foot in the door.

3.For example, find a simple algorithm for solving the following problem and classify it using big-theta notation:Divide a group of people into two disjoint subgroups (of arbitrary size) such that the difference in the total ages of the members of the two subgroups is as large as possible.Now change the problem so that the desired difference is as small as possible and classify your approach to the problem.


Solution Summary

Pseudocode and commentary

Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$3.99)
Included in Download
  • Plain text response
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse