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
Name 3 examples of operating system software that are not Windows based.
anyanavicka [17]
Ubuntu, Linux, and Mint
4 0
3 years ago
HELP PLZZ WILL MARK BRAINLIEST
adoni [48]

Answer:

if you could capture another image of this work bc I cant make out some words I can barley make out words

4 0
3 years ago
What does &lt;3 mean at the end of a message?
adelina 88 [10]
It is supposed to symbolize a heart, signifying love.
8 0
4 years ago
What are the elements of an autobiographical narrative similar to those of a short story?
sattari [20]
A. because the form is about stories from events in a writer's life
6 0
3 years ago
2. Read the following scenarios about how three different programmera approach
zheka24 [161]

Answer: A or B

Explanation: I think it's A or B Because they are the ones that make more sence

4 0
3 years ago
Read 2 more answers
Other questions:
  • A company is a Microsoft 365 reseller. The company does not provide managed services or direct customer support. You need to pro
    10·1 answer
  • True or False: You cannot change the default margin size for Word documents.  
    6·1 answer
  • Imported data that maintains a refreshable link to its external source is called ____ data.
    7·1 answer
  • What is the difference between head header and heading in HTML​
    8·1 answer
  • A(n) __________ item is a hardware or software item that is to be modified and revised throughout its life cycle.
    6·2 answers
  • What is the family access code right now?
    5·1 answer
  • Which is NOT one of the basic characteristics of life? What feature of Microsoft
    5·1 answer
  • What are your strongest competencies? What will you do them? <br>❌NONSENSE ANSWER<br>​
    9·1 answer
  • Debugging 2.17.3: Debug: The Two Towers Code Hs
    15·1 answer
  • When would instant messaging be the least effective means of communication
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!