Most of the programs that I saw produced the results in a linear manner , like displaying a normal one-dimensional array. But here I have a circular queue, and the elements in it must be displayed LIKE a circular queue.
Asked
Active
Viewed 80 times
0
-
Welcome to Stack Overflow. Please read the [**About**](http://stackoverflow.com/tour) page soon and also visit the links describing [**How to Ask a Question**](http://stackoverflow.com/questions/how-to-ask) and [**How to create a Minimal, Complete, and Verifiable example**](http://stackoverflow.com/help/mcve). Providing the necessary details, including your code, compiler warnings and associated errors, if any, will allow everyone here to help you with your question. – David C. Rankin Oct 28 '19 at 03:09
-
Show code, please. – Javier Silva Ortíz Oct 28 '19 at 03:11
-
A circular queue generally uses a fixed memory buffer in a circular manner to maintain a linear data list without requiring moving elements or using dynamic memory allocation to accommodate entries entries being added or removed from its ends. Displaying its contents at any point in time from one end to the other would look like a normal one dimensional queue. It sounds like you are dealing with something else, but I don't understand what it is or what you are expecting. Could you explain more? It might be interesting. – Avi Berger Oct 28 '19 at 04:31
-
What is a circular display manner, exactly? Do you want to see a circle on your screen, and the elements displayed all around the circle? – user253751 Oct 28 '19 at 11:23
-
Alright, generally we display an array like this - `for(i=0; i
– Ajay Kumar Prasad Oct 29 '19 at 14:17 -
OK, it is probably useless, but if you want them displayed like that, what graphics API would you like to use? If you just want to print text labels on the circumference of a circle then you need to understand some basic trigonometry. – Gem Taylor Oct 29 '19 at 15:12
-
If you wanted to do "something" in text mode, you could probably print the root node at the top of the display the the last and first nodes on the next row, the second and next-to-last nodes on the next row, and so-on until you get to the middle node at the bottom. With some clever spacing (did I mention trigonometry?) you could make it look like a circle. You could easily make it look like a diamond, to start with. – Gem Taylor Oct 29 '19 at 15:15
-
That does makes sense. Thanks. @GemTaylor . – Ajay Kumar Prasad Nov 11 '19 at 03:01