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
pentagon [3]
4 years ago
15

What is queue operations in datastructures?

Computers and Technology
1 answer:
ozzi4 years ago
8 0

Answer:

<u>Queue</u>- It is a data structure,unlike stacks we can insert and delete elements from both sides.

It works on the principle FiFo(first in first out) i.e the element which is inserted at the starting will be the one for deleting.  

We can perform many operations on queue like enqueue(),dequeue() and many more.

<u>Queue Operations</u>

enqueue()-This operation is used to add elements in Queue,we add element to rear.

        <u> Example-</u>

           Queue.prototype.enqueue = insertval(5)

               {  

                  this.array.push(5);  //inserting elements to a queue

                }  

dequeue()-This operation is used to remove elements from Queue,while removing data from front.  

<u> Example-</u>

           Queue. prototype. dequeue = removalval(5)

           {  

             this.array.pop(5);  //removing elements from a queue

           }

<u>peek()</u>-This operation is used to get the element from front i.e first element.

   <u>Example-</u>  

                      int peek()

                          {

                             return queue[front];

                          }

isfull()-This operation is used to check whether the queue is full or not.

 Example-

         bool isfull()

                 {

                 if(rear == MAXSIZE - 1) //checking queue is full

                     return true;

                 else

                      return false;

               }

isempty()-This operation is used to check whether the queue is empty or not.

  Example

 bool isempty()

     {

    if(front < 0 || front > rear)  //checking queue is empty or not

        return true;

   else

        return false;

     }

You might be interested in
What is an effective way to record change management? (5 points)
yanalaym [24]

Answer:

Detailed Notes

Explanation:

I took the 2.04 quiz

3 0
4 years ago
Small-business owner Marcos set up his Google Ads campaign by thinking of “obvious” keywords off of the top of his head. What's
LiRa [457]

Answer:See the suggestions on the Opportunities tab

Explanation: The improvement in the Google ad can be made by the taking a look at the Opportunities tab which will display the adequate opportunities.

The tab displays these opportunities on the basis of the campaign settings, account's history, performance, style, trends etc and thus will create the appropriate opportunities accordingly.Thus Marcos will have to see the suggestion displayed on Opportunities tab

5 0
3 years ago
The power relationship on a transformer states that O Power in = power out + loss O Power in = 1/2 power out (Power in = 2 x pow
lions [1.4K]

Answer:

D

Explanation:

5 0
3 years ago
It can store 5 times more data <br>than DVD and has scratch<br>resistance property.​
pav-90 [236]
Is this the full question?
7 0
3 years ago
While using a Web-based order form, an attacker enters an unusually large value in the Quantity field. The value she entered is
maxonik [38]

Answer: integer overflow

Explanation:

The type of attack has occurred in this scenario is a integer overflow. An integer overflow occurs when there's an attempt by an arithmetic operation to create a numeric value which is outside the range which the given numbers are able to represent.

In this, the integer overflow occurs when the result of the integer operation cannot be able to fit in the allocated memory space which then brings about an unexpected result.

6 0
3 years ago
Other questions:
  • Tanya has received an email, apparently from her bank, stating that some of her records were lost during server maintenance work
    13·2 answers
  • Plz answer me will mark as brainliest ​
    7·2 answers
  • Jenny is the project manager and her company. She needs to break her current project into parts that her employees can work on.
    10·1 answer
  • What are informational sessions?
    15·1 answer
  • Select the correct answer.
    11·1 answer
  • In this lab, your task is to complete the following: Enable all of the necessary ports on each networking device that will allow
    9·1 answer
  • Fundamental of Computer Science
    15·1 answer
  • What is the difference between
    14·1 answer
  • How is distributed ledger technology (DLT) used in a blockchain?
    8·1 answer
  • you are asked to create a four-digit code using the numbers from 1 to 9. how many possible codes are there--assuming that number
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!