Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

One of the main problems with the linear queue is the lack of appropriate utilization of space. Assume that the queue can store 100 elements & the complete queue is full. Thus, it means that the queue is holding 100 elements. In case, some elements at the front are deleted, at the last position the element in the queue continues to be at the similar position and there is no competent way to determine that the queue is not full. In this way, space utilization in the case of linear queues is not competent. This problem is arising because of the representation of the queue.

The substitute representation is to illustrate the queue as circular. In case, we are representing the queue by using arrays, then, a queue along n elements begin from index 0 and ends at n-1.So, obviously , the first element in the queue will be at index 0 and the last element will be at n-1 while all the positions among index 0 & n-1(both inclusive) are filled. Under such situation, front will point to 0 and rear will point to n-1. Though, while a new element is to be inserted and if the rear is pointing to n-1, then, it has to be checked if the position at index 0 is free. If yes, then the element can be inserted to that position & rear can be adjusted accordingly. In this way, the utilization of space is enhanced in the case of a circular queue.

In a circular queue, front will point to one position less to the first element anti-clock wise. Thus, if in the array the first element is at position 4, then the front will point to position 3. While the circular queue is created, then both front & rear point to index 1. Also, we can conclude that the circular queue is empty in case front & rear both point to the same index. Figure  illustrates a circular queue.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9619071

Have any Question?


Related Questions in Computer Engineering

Taskwrite an essay according to the following

Task Write an essay according to the following instructions. Your lecturer will provide few links for relevant articles and/or case studies. These will be available to you just after your second assignment submission dat ...

Can someone please wirte a complete algorith in c language

Can someone please wirte a complete algorith in c language that works without any errors on Visual Studio 2015 Given a list of integers, write a C function, similar to the partition process in QuickSort, that will rearra ...

What are some skills individuals who work in the field of

What are some skills individuals who work in the field of cyber security need to prevent hacks in to a company's computers?

You are requested to design an information technology

You are requested to design an Information Technology Infrastructure for an international nonprofit organization. The organization has six offices, one each in Ohio, Kentucky, Toronto, Michigan, Chicago, and Indiana. Col ...

Research the web for an example of a startup using a cloud

Research the Web for an example of a startup using a cloud infrastructure. What were the main reasons for choosing a cloud infrastructure? What alternatives did the startup have? Answer should be at least 1 page long dou ...

How do you calculate the annual interest rate of 12

How do you calculate the annual interest rate of 12% compounded monthly. I know how to do for annually but not monthly. You are offered the opportunity to put some money away for retirement. You will receive 10 annual pa ...

Describe a ping of death attack as an attack that causes

Describe a ping of death attack as an attack that causes the victim computer to freeze and malfunction.

There is a small company which in some months maintains an

There is a small company which in some months maintains an office in Aukland (code A) and in others in Brisbane (code B), and moves back and forth between these two cities (they can only afford to have one office operati ...

Question 1-what is cost and benefit analysis explain the

Question: 1- What is cost and benefit analysis? Explain the two different types of costs and two different types of benefits. 2- Discuss root-cause analysis as a BPA activity. What are the strengths and limitations of th ...

The diet doctor claims that the average north american is

The diet doctor claims that the average North American is more than 20 pounds overweight. To test his claim, a random sample 30 Of north Americans was weighted, the difference between their actual weight and their ideal ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As