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
guajiro [1.7K]
3 years ago
13

Whatis the restriction placed on the push operation for an array-based implementation of a stack?

Computers and Technology
1 answer:
tatuchka [14]3 years ago
8 0

Answer:

if the number of elements in the array are equal to the size of the array then return -1.

Explanation:

We are implementing stack using array.Stack is a LIFO(Last In First Out) type data structure.Insertion and deletion is from one end only.

So while push operation or inserting elements in the stack using array we have to check that the capacity of array is not reached.If reached then no element can be inserted in the stack.If not then we can insert element in the stack.

You might be interested in
How do you implement instruction-level parallelism?
USPshnik [31]

A. by combining similar instructions into groups, which will then execute in parallel

5 0
3 years ago
Read 2 more answers
Kyra needs help deciding which colors she should use on her web page. What can she use to help her decide?
german
The correct answer is the first one : a. Colour selection
7 0
3 years ago
Read 2 more answers
Create a new Java project/class called Examine1. Prompt user as to how many numbers they would like to enter. Use a cumulative s
Zinaida [17]

Answer:

Explanation:

The following code is written in Java and like requested prompts the user for a number to continue or a letter to exit. Then loops and keeps adding all of the numbers to the sum variable and adding 1 to the count for each number entered. Finally, it prints the sum and the average using printf and the variables.

import java.util.Scanner;

class Examine1 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int sum = 0;

       int count = 0;

       System.out.println("Enter a number to continue or a letter to exit.");

       while(in.hasNextInt()) {

           System.out.println("Enter a number:");

           sum += in.nextInt();

           count += 1;

       }

       System.out.printf("The sum is %s.%n", sum);

       System.out.printf("The average is %s.", (sum / count));

   }

}

8 0
3 years ago
Joe is a computer service technician. People in his neighborhood usually depend on his suggestions for purchasing any computer a
ser-zykov [4K]

Answer:

C

Explanation:

Because he's knowledge ,everyone asking he's opinion if i am not wrong.

I hope i did help you on this questions

8 0
4 years ago
Read 2 more answers
Write a function swaparrayends() that swaps the first and last elements of the function's array parameter. ex: sortarray
Katena32 [7]
Def swapArrayEnds( array ):
    tmp = array[ len( array ) - 1 ]
    array[ len( array ) - 1 ] = array[ 0 ]
    array[ 0 ] = tmp


3 0
3 years ago
Other questions:
  • A database administrator (DBA) must have a clear understanding of the fundamental business of an organization, be proficient in
    9·1 answer
  • What are some examples of objects by which you can browse in the select browse option
    6·1 answer
  • Match each scenario to the absolute value expression that describes it. 1. the distance moved when going backwards five spaces i
    13·2 answers
  • Which of the following is considered a benefit of using simulation programs? a. They allow users to experience potentially dange
    10·1 answer
  • Choose the correct term to complete the sentence.
    12·1 answer
  • 3. Comparing the Utopian and dystopian views of Technology according to Street (1992) which one in your view is more applicable
    9·1 answer
  • What peripheral displays us the image on a computer?​
    13·1 answer
  • Urgent. I will mark you brainliest. explain why cyber warfare is a real threat.​
    10·2 answers
  • Wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww!
    7·1 answer
  • 8. What is the order of growth execution time of the push operation when using the LinkedStack class, assuming a stack size of N
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!