1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zvonat [6]
3 years ago
8

Write an algorithm in pseudocode or english that would describe how to use a stack to reverse any list.

Computers and Technology
1 answer:
s2008m [1.1K]3 years ago
3 0
Int data[n];
int rev[n];

for (i=0; i < n; i++)
     stack.push(data[n]);
for (i=0; i <n; i++)
     rev[i] = stack.pop();

You might be interested in
A critical piece of equipment that provides power to systems even during a black out is called a(n) _______________.
storchak [24]

Answer:C) Uninterruptible power supply

Explanation:Uninterruptible power supply(UPS) is the device that is used when the input source of power does not work or fails and thus it acts as a power supply in the emergency situation.This electronic devices in the protection of the hardware components of computer system etc.

Other option are incorrect because power strips, surge protector and password generator are no the devices that work during the power black out situation.Thus, the correct option is option(C).

7 0
3 years ago
Match the cell reference to its definition,
Anna35 [415]

Answer:

Absolute reference- the cell remains constant when copied or moved

Relative reference- the cell changes based on the position of rows and columns

Mixed references- the cell has combination of two other types of cell references

Explanation:

4 0
2 years ago
A(n) _____ chart is drawn on the same worksheet as the data.
svet-max [94.6K]
A is the answer because it makes more sense.............
5 0
3 years ago
Create an application containing an array that stores eight integers. The application should call five methods that in turn:
Rus_ich [418]
<h2><u>Answer</u>:</h2>

public class ArrayMethodDemo {

   public static void main (String args[]) {

       int[] numbers = {12, 15, 34, 67, 4, 9, 10, 7};

       int limit = 12;

       display(numbers);

       displayReverse(numbers);

       displaySum(numbers);

       displayLessThan(numbers, limit);

       displayHigherThanAverage(numbers);

   }

   

   public static void display(int[] numbers) {

       

       //Message to be displayed before printing out the numbers

      System.out.print("Numbers in the array: ");

       

       //loop through the numbers in the array and print each number

       for(int x: numbers){

           System.out.print(x + " ");

       }

       

       //print a new line

       System.out.println();

   }

   

   public static void displayReverse(int[] numbers) {

       

       //Message to be displayed before printing out the reverse of the array

       System.out.print("Reverse of the array numbers: ");

       

       

       //loop through the array starting from the last index

       for(int i = numbers.length - 1; i > 0; i--){

           System.out.print(numbers[i] + " ");

       }

       

       //print a new line

       System.out.println();

   }

   

   public static void displaySum(int[] numbers) {

       

       //initialize the sum variable

       int sum = 0;

       

       //loop through the array and add each element to sum

       for(int i = 0; i < numbers.length; i++){

           sum += numbers[i];

       }

       

       //print out the sum

      System.out.println("Sum: "  + sum);

       

   }

   

   public static void displayLessThan(int[] numbers, int limit) {

       

       //Text to be displayed before printing values less than the limit

       System.out.print("Values less than limit (" + limit + "): ");  

       //loop through the array and print numbers lower than the specified limit

       for(int i = 0; i < numbers.length; i++){

           if(numbers[i] < limit){

               System.out.print(numbers[i] + " ");

           }

       }

       

       //print a new line

       System.out.println();

   }

   

   public static void displayHigherThanAverage(int[] numbers) {

       //initialize the average variable

       double average = 0.0;

       

       //initialize the sum variable

       int sum = 0;

       

       

       //loop through the array and add each element to sum

      for(int i = 0; i < numbers.length; i++){

           sum += numbers[i];

       }

       

       //calculate the average

      average = sum / numbers.length;

       

       //Message to be displayed before printing the values higher than the average

       System.out.print("Values higher than average (" + average + "): ");

       

       

       //loop through the array and print numbers higher than the calculated average

      for(int i = 0; i < numbers.length; i++){

           if(numbers[i] > average){

               System.out.print(numbers[i] + " ");

           }

       }

       

       //print a new line

       System.out.println();

   }

   

}

<h2><u>Sample Output:</u></h2>

Numbers in the array: 12 15 34 67 4 9 10 7  

Reverse of the array numbers: 7 10 9 4 67 34 15  

Sum: 158

Values less than limit (12): 4 9 10 7  

Values higher than average(19.0):34 67

<h2>Explanation:</h2>

The code above contains comments explaining important parts of the code. Kindly go through the comments. A sample output, arising from running the application, has also been added to ace understandability.

6 0
3 years ago
How does tracking changes relate to sharing a workbook in Excel?
ElenaW [278]

Answer:When you highlight changes as you work, Excel outlines any revisions (such as changes, insertions, and deletions) with a highlighting color. On the Review tab, click Track Changes, and then click Highlight Changes. Select the Track changes while editing. This also shares your workbook check box.

Explanation:

8 0
3 years ago
Other questions:
  • A "shooting star," or meteor, is actually a meteoroid that burns up in Earth's atmosphere.
    13·1 answer
  • This software system shall consist of four source files (.cpp) and four header files (.h) defining four classes. The first class
    6·1 answer
  • Joe, a user, has just installed his first home wireless router. Which of the following tasks should be considered to help secure
    8·1 answer
  • Although designed to support remote dial-in access to a corporate network, what service below is commonly used with 802.1x port
    12·1 answer
  • Assume a 16-word direct mapped cache with b=1 word is given. Also assume that a program running on a computer with this cache me
    6·1 answer
  • Use a recursion tree to determine a good asymptotic upper bound on the recurrence T(n) = 4T(n/2 + 2) + n. Use the substitution m
    5·1 answer
  • In this project you will demonstrate your knowledge of decision making blocks such as if statements. Objectives Building on ever
    11·1 answer
  • Which of the following is NOT a useful strategy when making an informed purchase ?
    7·1 answer
  • What is the unofficial name given to the culture that has emerged from living in the age of digital media, whereby people are fr
    7·2 answers
  • What is being identified when antibodies stick to pathogens during immunostaining?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!