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
. Write programming code in C++ for school-based grading system
AleksAgata [21]

Explanation:

The grade must be calculated based on following pattern:

Average Mark RangeGrade91-100A181-90A271-80B161-70B251-60C141-50C233-40D21-32E10-20E2

Calculate Grade of Student in C++

To calculate grade of a student on the basis of total marks in C++ programming, you have to ask from user to enter marks obtained in 5 subjects. Now add marks of all the 5 subjects and divide it by 5 to get average mark. And based on this average mark, find grade as per the table given above:

// C++ Program to Find Grade of Student // -------codescracker.com------- #include<iostream> using namespace std; int main() { int i; float mark, sum=0, avg; cout<<"Enter Marks obtained in 5 Subjects: "; for(i=0; i<5; i++)

6 0
3 years ago
What are examples of templates the Input Mask Wizard offers? Check all that apply.
Vesna [10]
The answer is A B AND D mark me brainliest?
5 0
3 years ago
Read 2 more answers
How to see if your computer has bluetooth?
RUDIKE [14]
Assuming you're running Windows, click the start button, and then search for "Device Manager" (or open CMD or PowerShell and type devmgmt.msc). Look at the list of devices. If Bluetooth is there, you have it; if it's not there, you don't. 
3 0
3 years ago
Question 2 of 10
horrorfan [7]

Answer:

Lowest Level; Machine Language.

Explanation:

The lowest level of a computer is machine language, which are strings of 0's and 1's in bits, and it's possible to perform tasks at this level. It's however difficult to do and humans created <em>Assembly</em>; a type of low level programming language to be readable, and converts to machine language so that we don't have to work in binary.

4 0
2 years ago
Which part holds the "brains" of the computer?
Rus_ich [418]
The (CPU) holds the “brains” of the computer
7 0
3 years ago
Other questions:
  • ACCOUNTING
    13·2 answers
  • You work administrative assistant in an engineering firm. A co-worker constantly makes fun of the engineers by whispering commen
    13·1 answer
  • Use this option to view your presentation as your audience will see it. a.File menu b.Play button c.Slide Show button d.Tools me
    6·2 answers
  • Your program will demonstrate use of arrays, searching an array, using methods, passing parameters by reference, returning value
    13·1 answer
  • What differentiates physical design from logical design?
    7·1 answer
  • Enterprise Resource Planning (ERP) is an example of a single user database.
    7·1 answer
  • In this scenario, hackers launch cyber-attacks that affect several parts of the nationâs financial infrastructure over the cours
    8·1 answer
  • The Internet began when a large company wanted to sell products online. <br> True or flase?
    6·2 answers
  • The computer stores currently used programs and data in ________.
    9·2 answers
  • What do we call the software which programmers use to program?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!