The pseudocode :
Pair MaxiMini(array, sizeof_array)
if sizeof_array = 1
return element as both maximum and minimum
else if sizeof_array = 2
do one comparison to find the maximum and minimum
return that pair
else
# sizeof_array > 2
recursion for maximum and minimum of the left half
recursion for maximum and minimum of the right half
one comparison determines the true max of the two elements
one comparison determines the true min of the two elements
return the pair of maximum and minimum
They can hack into you email or your phone number thats all they need to find where you live how old you are and etc hope this helps
Answer:
Explanation:
A stack item behaves like Last In First Out, which is equivalent to First In Last Out. FIFO and LILO are also equivalent, but they describe a queue.
Answer:
// here is code in java.
import java.util.*;
class Solution
{
// main method of class
public static void main (String[] args) throws java.lang.Exception
{
try{
// declare variable
double caffeine;
// scanner object to read input from user
Scanner scr=new Scanner(System.in);
System.out.print("Enter the initial amount of caffeine:");
// read the initial amount of caffeine
caffeine=scr.nextDouble();
// calculate amount of caffeine after 6,12,18 hours
for(int i=1;i<=3;i++)
{
System.out.println("After "+ i*6+" hours:"+(caffeine/2)+" mg");
// update the caffeine after every 6 hours
caffeine=caffeine/2;
}
}catch(Exception ex){
return;}
}
}
Explanation:
Create a variable "caffeine" to store the initial amount of caffeine given by user. Run a loop for three time, it will calculate the amount of caffeine left after every 6 hours.First it will give the amount of caffeine left after 6 hours, then caffeine left after 12 hours and in last caffeine after 18 hours.
Output:
Enter the initial amount of caffeine:100
After6 hours:50.0 mg
After12 hours:25.0 mg
After18 hours:12.5 mg
As Viet drives around and checks meters to document the amount of electricity used in homes he would be part of the energy distribution process since the electricity is distributed off a power line into the house and then within the house by the wiring to the lights and the electrical outlets for usage by the inhabitants.