Question

Explain double ended queue as an array ? and what are the real world example of...

Explain double ended queue as an array ? and what are the real world example of double ended queue. Explain?

Homework Answers

Answer #1

/*If you any query do comment in the comment section else like the solution*/

An array can be used a deque by using two pointers front and rear both of them pointing to -1 initially when queue is empty, when new element is inserted rear is incremented, front is also incremented in case front and rear both are pointing to index -1. When index of rear becomes equal to size of array we say that array is full. When an element is removed, front index is incremented and if front becomes greater than the rear index then we say that queue is empty.

Browsing history uses deque in which new urls are inserted at the front of the queue which makes recent urls visited to appear at the top of the list and old urls visited is removed from the rear end after a particular point of time.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What is a real world example of the cost concept
What is a real world example of the cost concept
Explain a real-world example of when a hypothesis test could be used. The example can use...
Explain a real-world example of when a hypothesis test could be used. The example can use real data or data that you make up, such as values for the mean, standard deviation, and sample size. Be sure to note if the standard deviation is from the population or the sample.
  Provide a real world example of a Type I error. 2.  Explain what a critical value is,...
  Provide a real world example of a Type I error. 2.  Explain what a critical value is, and explain how it is used to test a hypothesis. 3.  Explain what a p-value is, and explain how it is used to test a hypothesis. 4.  How do we decide whether to use a z test or a t test when testing a hypothesis about a population mean?
1. Provide a real world example of a Type I error. 2. Explain what a critical...
1. Provide a real world example of a Type I error. 2. Explain what a critical value is, and explain how it is used to test a hypothesis. 3. Explain what a p-value is, and explain how it is used to test a hypothesis. 4. How do we decide whether to use a z test or a t test when testing a hypothesis about a population mean?
Find an example of a data sample in the real world (newspaper/ journal/ online) and explain...
Find an example of a data sample in the real world (newspaper/ journal/ online) and explain the sample you found. Please tell us if it was qualitative data or quantitative data.
What is the difference between: Final goods and intermediate goods? Then Provide a real world example...
What is the difference between: Final goods and intermediate goods? Then Provide a real world example of each one.(10) and what is the diffrence between GDP and GNP. Explain in detail. (15) in your own words
Give a real world example of a duopoly and a cartel.
Give a real world example of a duopoly and a cartel.
Provide a real-world example of a market that approximates each oligopoly setting, and explain your reasoning....
Provide a real-world example of a market that approximates each oligopoly setting, and explain your reasoning. (LO2) a. Cournot oligopoly. b. Stackelberg oligopoly. c. Bertrand oligopoly. No textbook answers please
What are a few real world examples of an XOR gate? For example a light bulb...
What are a few real world examples of an XOR gate? For example a light bulb controlled by two separate switches.
What is meant by the Hartwick Rule? Construct a real-world example that would illustrate this concept.
What is meant by the Hartwick Rule? Construct a real-world example that would illustrate this concept.