Algorithm
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.
By OTA: James Achuff, MBA
OTA Rating: 4.9/5
Your Price: $2.19 (original value ~$3.99)
What's included:
Page generated in 0.0557 seconds