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
Olegator [25]
2 years ago
9

Assume you are using the text's array-based queue and have just instantiated a queue of capacity 10. You enqueue 5 elements and

then dequeue 2 elements. Which indices of the internal array elements hold the remaining elements
Computers and Technology
1 answer:
ASHA 777 [7]2 years ago
3 0

The indices of the internal array elements that hold the remaining elements is c) 2 to 4

<h3>Calculations and Parameters:</h3>

For us to create a capacity of 10 for the queue, we would enqueue:

We would create a queue of capacity 10:

<h3>Queue q(10);</h3>

We add elements/enqueue 5 elements to the queue :

  • q.queueEnqueue(10);
  • q.queueEnqueue(5);
  • q.queueEnqueue(8);
  • q.queueEnqueue(9);
  • q.queueEnqueue(2);

Printing this would give:

q. queueDisplay()

10, 5, 8, 9, 2

Next, we would remove elements/dequeue 2 elements from the queue :

q. queuedequeue();

q. queuedequeue();

Printing it would be:

q. queueDisplay()

8 ,9, 2

Observing this, the deletion/dequeue starts from the front/first index.

The remaining indices of the internal array elements are: 2, 3, 4 or 2 to 4

Read more about arrays and enqueue here:

brainly.com/question/24188935

#SPJ1

You might be interested in
Write a application that can determine if a 5 digit number you input is a palindrome. If the number is a palindrome then print "
notsponge [240]

Answer:

Written in Python:

num = int(input("Number: "))

strnum = str(num)

if len(strnum) !=5:

    print("Length must be 5")

else:

    if(strnum[::-1] == strnum):

         print("The number is a palindrome.")

    else:

         print("The number is NOT palindrome.")

Explanation:

This prompts user for input

num = int(input("Number: "))

This converts user input to string

strnum = str(num)

This checks the length of the string

if len(strnum) !=5:

    print("Length must be 5") If length is not 5, this prompt is printed

else:If otherwise

    if(strnum[::-1] == strnum): The compares the string reversed with the original

         print("The number is a palindrome.") If both are the same, this line is executed

    else:

         print("The number is NOT palindrome.") If otherwise, this line is executed

4 0
3 years ago
Because health and safety are important in all workplaces, not just hazardous ones, what working conditions must ALL employers p
antiseptic1488 [7]
A since fire extinguishers are legally enforced 
5 0
4 years ago
Read 2 more answers
Suppose you want your firewall to block all incoming Telnet connections but to allow outbound Telnet connections. One approach w
Vera_Pavlovna [14]

Answer:

Another way to block all inbound packets is to use the firewall layer of the circuit.

Explanation:

The firewall circuit layer is a firewall containing a table with four fields, mainly such as source port, destination port, source IP address, and destination IP address.

They are containing mainly the addresses or the ports that need to be blocked.   So we want to block all inbound packets, and also set the source port to 23 while the rest is set to zero, meaning that all inbound packets are blocked.

5 0
3 years ago
Write a C++ program to count even and odd numbers in array. The array size is 50. The array elements will be entered by the user
vlabodo [156]

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int numbers[50];

   int evekount = 0, odkount = 0;

   for(int i = 0; i<50;i++){

       cin>>numbers[i];

       if(numbers[i]%2==0){            evekount++;        }

       else{            odkount++;        }

   }

   cout<<"Even Count: "<<evekount<<endl;

   cout<<"Odd Count: "<<odkount<<endl;

   return 0;

}

Explanation:

This declares the integer array of number

   int numbers[50];

This initializes the even count and odd count to 0

   int evekount = 0, odkount = 0;

This iterates from 1 to 50

   for(int i = 0; i<50;i++){

This gets input for the array

       cin>>numbers[i];

This checks for even

<em>        if(numbers[i]%2==0){            evekount++;        }</em>

This checks for odd

<em>        else{            odkount++;        }</em>

   }

This prints the even count

   cout<<"Even Count: "<<evekount<<endl;

This prints the odd count

   cout<<"Odd Count: "<<odkount<<endl;

3 0
3 years ago
What UDP port is used by a default WDS server setup when it is listening for PXE boot requests​
Vera_Pavlovna [14]
WDS uses Port 4011 to listen to PXE boot requests
8 0
3 years ago
Other questions:
  • Two electronics technicians are looking at the representations of a silver atom and a copper atom in the figure above. Technicia
    10·1 answer
  • What is a block cipher algorithm that operates on 64-bit blocks and can have a key length from 32 to 448 bits?
    8·1 answer
  • If a secret key is to be used as a _________ for conventional encryption a single number must be generated.
    13·1 answer
  • The _____ is a blinking vertical line that indicates where the next typed character will appear. scroll box sheet tab insertion
    7·1 answer
  • PLEASE HELP ASAP!!
    11·1 answer
  • Which of the following substances increases in quantity during repititive muscle contraction during oxygen deficti ?
    11·1 answer
  • In python, Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and "non-negative" ot
    12·1 answer
  • Differences between dot_mattix printer and a line printer
    12·1 answer
  • Drag the tiles to the boxes to form correct palrs.
    9·1 answer
  • Which of the following statements is correct? User data cannot be combined and shared among authorized users. In a nondatabase,
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!