Algorithm for insertion into the circular queue, Data Structure & Algorithms

Assignment Help:

Algorithm for insertion of any element into the circular queue:

Step-1: If "rear" of the queue is pointing at the last position then go to step-2 or else Step-3

Step-2: make the "rear" value as 0

Step-3: increase the "rear" value by one

Step-4: a. if the "front" points where "rear" is pointing & the queue holds a not NULL value for it, then it's a "queue overflow" state, thus quit; else go to step-b

b. Insert the new value for the queue position pointed by the "rear"


Related Discussions:- Algorithm for insertion into the circular queue

Array and two-dimensional array, Q. Describe the term array.  How do we rep...

Q. Describe the term array.  How do we represent two-dimensional arrays in memory?  Explain how we calculate the address of an element in a two dimensional array.

Indexed sequential file organisation, When there is requirement to access r...

When there is requirement to access records sequentially by some key value and also to access records directly by the similar key value, the collection of records may be organized

Tree structure, We would like to implement a 2-4Tree containing distinct in...

We would like to implement a 2-4Tree containing distinct integer keys. This 2-4Tree is defined by the ArrayList Nodes of all the 2-4Nodes in the tree and the special 2-4Node Root w

Write an algorithm to find outputs number of cars, A company is carrying ou...

A company is carrying out a survey by observing traffic at a road junction. Every time a car, bus or lorry passed by road junction it was noted down. 10 000 vehicles were counted d

Characterstics of good algorithm, what are the charaterstics to determine w...

what are the charaterstics to determine weather an algorithm is good or not? explain in detail

Random searching, write aprogram for random -search to implement if a[i]=x;...

write aprogram for random -search to implement if a[i]=x;then terminate other wise continue the search by picking new randon inex into a

Algorithm.., write an algorithm to sort given numbers in ascending order us...

write an algorithm to sort given numbers in ascending order using bubble sort

Depth of complete binary tree, What will be depth do , of complete binary t...

What will be depth do , of complete binary tree of n nodes, where nodes are labelled from 1 to n with root as node and last leaf node as node n

Queues, what is the difference between data type and abstract data type

what is the difference between data type and abstract data type

Example of telephone directory, A telephone directory having n = 10 records...

A telephone directory having n = 10 records and Name field as key. Let us assume that the names are stored in array 'm' i.e. m(0) to m(9) and the search has to be made for name "X"

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd