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
iogann1982 [59]
3 years ago
13

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 deque elements. Which indices of the internal array elements hold the remaining elements? a) 0 to 2 b) 7 to 9 c) 2 to 4 d) 1 to 3
Computers and Technology
1 answer:
Anika [276]3 years ago
7 0

Full question:

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 deque 2 elements. Which indices of the internal array elements hold the remaining elements? a) 0 to 2 b) 7 to 9 c) 2 to 4 d) 1 to 3

Answer and Explanation:

If you instantiate a capacity of 10 for the queue, you have the queue a capacity of not more than 10 values.

To enqueue means to add an element to the array(if it's not full, n<10)

To dequeue means to delete an element from the array or queue(if n! =0)

From the question, for example:

We create a queue of capacity 10:

Queue q(10);

We add elements/enqueue 5 elements to the queue :

q.queueEnqueue(10);

q.queueEnqueue(5);

q.queueEnqueue(8);

q.queueEnqueue(9);

q.queueEnqueue(2);

If we print this out:

q. queueDisplay()

We would get:

10, 5, 8, 9, 2

We remove elements/dequeue 2 elements from the queue :

q. queuedequeue();

q. queuedequeue();

We print it out:

q. queueDisplay()

8 ,9, 2

We observe that deletion/dequeue starts from the front/first index.

We are left with indices 2, 3, 4 or 2 to 4

Note: the above methods/ functions and objects used are merely for example purposes. The queue uses a floating front design approach.

You might be interested in
Which term is used to describe a computer-based method of communication in which users can type and view informal messages sent
Vsevolod [243]
The answer is instant messaging (IM).  This  is used to describe a computer-based method of communication in which users can type and view informal messages sent to one or more recipients, and view the responses immediately.  Instant Messaging (IM) <span>is a type of online chat that offers real-time text transmission over the Internet. </span>
3 0
4 years ago
IOS jail broken or Android unrooted which is better to hack with
Ira Lisetskai [31]
IOS Jail Broken - that is more advanced then an android
3 0
3 years ago
What is jcl language on the mainframe?
Pavel [41]
Job Control Language on the mainframe is the name for scripting language used on IBM mainframe operating system to instruct how to start a subsystem.
5 0
4 years ago
WILL GIVE BRAINLIEST! How do I create (and then print out) an int array of length n filled with 0's in Java? Please hurry, my ho
koban [17]

Answer:

press print icon on the top right corner

Explanation:

3 0
3 years ago
Order the steps to use a logical argument as a rule type.
muminat

Answer:

Click home tab, click conditional formatting, click new rule, use formula to determine

6 0
3 years ago
Read 2 more answers
Other questions:
  • Drag the tiles to the correct boxes to complete the pairs. Match the tools that you can use while solving a problem with their c
    6·2 answers
  • âthe first line in a hypertext markup language (html) file is the _____, which is a processing instruction indicating the markup
    9·2 answers
  • You would like the user of a program to enter a customer’s last name. Write a statement thaUse the variables k, d, and s so that
    5·1 answer
  • Which command group does a user need to access the Formula dialog box?
    11·1 answer
  • Jenny needs to record the names of 30 students, write down the subjects they studied, and note grades in each subject after the
    13·2 answers
  • A bug was discovered in Canvas where the website crashes if 2 or more students are writing a discussion post at the same time. I
    10·1 answer
  • Real GDP is found by removing the effects of inflation. How is this done mathematically?
    5·1 answer
  • Why might it be a good idea to choose a bus topology?
    6·2 answers
  • One lap around a standard high-school running track is exactly 0.25 miles. Write the function miles_to_laps() that takes a numbe
    8·1 answer
  • Which of the following are factors that can cause damage to a computer? Check all of the boxes that apply.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!