Cyclic queue using an array in C#Circular Bounded Queue using C#Implement data structure overflow...

And now you see it II (the B side)

Names of the Six Tastes

Identity of a supposed anonymous referee revealed through "Description" of the report

Illegal assignment from Id to List

As a small race with a heavy weapon, does enlage remove the disadvantage?

Can radiation block all wireless communications?

Opposite party turned away from voting when ballot is all opposing party

What is the oldest instrument ever?

My Sixteen Friendly Students

When I add a cylinder, it doesn't even show up on my screen at all

When an electron around an atom drops to a lower state, is 100% of the energy converted to a photon?

Are wands in any sort of book going to be too much like Harry Potter?

Mindfulness of Watching Youtube

Why does this pattern in powers happen?

Expl3 and recent xparse on overleaf: No expl3 loader detected

Align a table column at a specific symbol

Is it a good idea to copy a trader when investing?

Magical Modulo Squares

Sprout Reports plugin - How to output a Matrix field into a row

Can I bring back Planetary Romance as a genre?

Program for finding longest run of zeros from a list of 100 random integers which are either 0 or 1

Why did Ham the Chimp push levers?

Do these creatures from the Tomb of Annihilation campaign speak Common?

Is it safe to keep the GPU on 100% utilization for a very long time?



Cyclic queue using an array in C#


Circular Bounded Queue using C#Implement data structure overflow queueCircular queue implementation using two regionsPython backend interview: task management system for workersWPF async ObservableTaskQueue classMaking HttpWebRequest and not really interested in the responseImplementation of fixed size queue using a ring (cyclic) bufferGraphing a linear equation using javascript and htmlImplementation of a Resizing Array QueueCircular Queue Implementation Using Array in java






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3












$begingroup$


I tried to implement a cyclic Queue using an array, as a task from a coding interview.



Please comment about style, as well as any edge cases I may have missed.



using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CirucularArray
{
[TestClass]
public class CyclicQueueUsingArray
{
[TestMethod]
public void QueueTest()
{
CyclicQueue Q = new CyclicQueue(5);
Q.Enqueue(1);
Assert.AreEqual(1, Q.Front);
Q.Enqueue(2);
Assert.AreEqual(1, Q.Front);
Assert.AreEqual(2, Q.Rear);
Q.Enqueue(3);
Assert.AreEqual(1, Q.Front);
Assert.AreEqual(3, Q.Rear);

Assert.AreEqual(1, Q.Dequeue());
Assert.AreEqual(2, Q.Front);
Assert.AreEqual(3, Q.Rear);

Assert.AreEqual(2, Q.Dequeue());
Assert.AreEqual(3, Q.Front);
Assert.AreEqual(3, Q.Rear);

Assert.AreEqual(3, Q.Dequeue());
}

[TestMethod]
public void QueueOverflowTest()
{
CyclicQueue Q = new CyclicQueue(5);
Q.Enqueue(1);
Q.Enqueue(2);
Q.Enqueue(3);
Q.Enqueue(4);
Q.Enqueue(5);
Assert.AreEqual(1, Q.Dequeue());
Q.Enqueue(6);
Assert.AreEqual(2, Q.Front);
Assert.AreEqual(6, Q.Rear);
}
}

public class CyclicQueue
{
public int[] _buffer;
private int _start;
private int _end;
private int _size;
private int _maxSize;
public CyclicQueue(int maxSize)
{
_maxSize = maxSize;
_buffer = new int[_maxSize];
_start = 0;
_end = 0;
}
public void Enqueue(int newValue)
{
if (_size == _maxSize)
{
throw new OutOfMemoryException("Queue at full capacity");
}
if (_size > 0)
{
_end = (_end + 1) % _maxSize;
}
_buffer[_end] = newValue;
_size++;
}

public int Dequeue()
{
if (_size == 0)
{
throw new IndexOutOfRangeException("Queue is empty");
}

int result = _buffer[_start];
_size--;

_start = (_start + 1) % _maxSize;
return result;
}
public int Front
{
get { return _buffer[_start]; }
}

public int Rear
{
get { return _buffer[_end]; }
}
}
}









share|improve this question











$endgroup$



















    3












    $begingroup$


    I tried to implement a cyclic Queue using an array, as a task from a coding interview.



    Please comment about style, as well as any edge cases I may have missed.



    using System;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    namespace CirucularArray
    {
    [TestClass]
    public class CyclicQueueUsingArray
    {
    [TestMethod]
    public void QueueTest()
    {
    CyclicQueue Q = new CyclicQueue(5);
    Q.Enqueue(1);
    Assert.AreEqual(1, Q.Front);
    Q.Enqueue(2);
    Assert.AreEqual(1, Q.Front);
    Assert.AreEqual(2, Q.Rear);
    Q.Enqueue(3);
    Assert.AreEqual(1, Q.Front);
    Assert.AreEqual(3, Q.Rear);

    Assert.AreEqual(1, Q.Dequeue());
    Assert.AreEqual(2, Q.Front);
    Assert.AreEqual(3, Q.Rear);

    Assert.AreEqual(2, Q.Dequeue());
    Assert.AreEqual(3, Q.Front);
    Assert.AreEqual(3, Q.Rear);

    Assert.AreEqual(3, Q.Dequeue());
    }

    [TestMethod]
    public void QueueOverflowTest()
    {
    CyclicQueue Q = new CyclicQueue(5);
    Q.Enqueue(1);
    Q.Enqueue(2);
    Q.Enqueue(3);
    Q.Enqueue(4);
    Q.Enqueue(5);
    Assert.AreEqual(1, Q.Dequeue());
    Q.Enqueue(6);
    Assert.AreEqual(2, Q.Front);
    Assert.AreEqual(6, Q.Rear);
    }
    }

    public class CyclicQueue
    {
    public int[] _buffer;
    private int _start;
    private int _end;
    private int _size;
    private int _maxSize;
    public CyclicQueue(int maxSize)
    {
    _maxSize = maxSize;
    _buffer = new int[_maxSize];
    _start = 0;
    _end = 0;
    }
    public void Enqueue(int newValue)
    {
    if (_size == _maxSize)
    {
    throw new OutOfMemoryException("Queue at full capacity");
    }
    if (_size > 0)
    {
    _end = (_end + 1) % _maxSize;
    }
    _buffer[_end] = newValue;
    _size++;
    }

    public int Dequeue()
    {
    if (_size == 0)
    {
    throw new IndexOutOfRangeException("Queue is empty");
    }

    int result = _buffer[_start];
    _size--;

    _start = (_start + 1) % _maxSize;
    return result;
    }
    public int Front
    {
    get { return _buffer[_start]; }
    }

    public int Rear
    {
    get { return _buffer[_end]; }
    }
    }
    }









    share|improve this question











    $endgroup$















      3












      3








      3





      $begingroup$


      I tried to implement a cyclic Queue using an array, as a task from a coding interview.



      Please comment about style, as well as any edge cases I may have missed.



      using System;
      using Microsoft.VisualStudio.TestTools.UnitTesting;

      namespace CirucularArray
      {
      [TestClass]
      public class CyclicQueueUsingArray
      {
      [TestMethod]
      public void QueueTest()
      {
      CyclicQueue Q = new CyclicQueue(5);
      Q.Enqueue(1);
      Assert.AreEqual(1, Q.Front);
      Q.Enqueue(2);
      Assert.AreEqual(1, Q.Front);
      Assert.AreEqual(2, Q.Rear);
      Q.Enqueue(3);
      Assert.AreEqual(1, Q.Front);
      Assert.AreEqual(3, Q.Rear);

      Assert.AreEqual(1, Q.Dequeue());
      Assert.AreEqual(2, Q.Front);
      Assert.AreEqual(3, Q.Rear);

      Assert.AreEqual(2, Q.Dequeue());
      Assert.AreEqual(3, Q.Front);
      Assert.AreEqual(3, Q.Rear);

      Assert.AreEqual(3, Q.Dequeue());
      }

      [TestMethod]
      public void QueueOverflowTest()
      {
      CyclicQueue Q = new CyclicQueue(5);
      Q.Enqueue(1);
      Q.Enqueue(2);
      Q.Enqueue(3);
      Q.Enqueue(4);
      Q.Enqueue(5);
      Assert.AreEqual(1, Q.Dequeue());
      Q.Enqueue(6);
      Assert.AreEqual(2, Q.Front);
      Assert.AreEqual(6, Q.Rear);
      }
      }

      public class CyclicQueue
      {
      public int[] _buffer;
      private int _start;
      private int _end;
      private int _size;
      private int _maxSize;
      public CyclicQueue(int maxSize)
      {
      _maxSize = maxSize;
      _buffer = new int[_maxSize];
      _start = 0;
      _end = 0;
      }
      public void Enqueue(int newValue)
      {
      if (_size == _maxSize)
      {
      throw new OutOfMemoryException("Queue at full capacity");
      }
      if (_size > 0)
      {
      _end = (_end + 1) % _maxSize;
      }
      _buffer[_end] = newValue;
      _size++;
      }

      public int Dequeue()
      {
      if (_size == 0)
      {
      throw new IndexOutOfRangeException("Queue is empty");
      }

      int result = _buffer[_start];
      _size--;

      _start = (_start + 1) % _maxSize;
      return result;
      }
      public int Front
      {
      get { return _buffer[_start]; }
      }

      public int Rear
      {
      get { return _buffer[_end]; }
      }
      }
      }









      share|improve this question











      $endgroup$




      I tried to implement a cyclic Queue using an array, as a task from a coding interview.



      Please comment about style, as well as any edge cases I may have missed.



      using System;
      using Microsoft.VisualStudio.TestTools.UnitTesting;

      namespace CirucularArray
      {
      [TestClass]
      public class CyclicQueueUsingArray
      {
      [TestMethod]
      public void QueueTest()
      {
      CyclicQueue Q = new CyclicQueue(5);
      Q.Enqueue(1);
      Assert.AreEqual(1, Q.Front);
      Q.Enqueue(2);
      Assert.AreEqual(1, Q.Front);
      Assert.AreEqual(2, Q.Rear);
      Q.Enqueue(3);
      Assert.AreEqual(1, Q.Front);
      Assert.AreEqual(3, Q.Rear);

      Assert.AreEqual(1, Q.Dequeue());
      Assert.AreEqual(2, Q.Front);
      Assert.AreEqual(3, Q.Rear);

      Assert.AreEqual(2, Q.Dequeue());
      Assert.AreEqual(3, Q.Front);
      Assert.AreEqual(3, Q.Rear);

      Assert.AreEqual(3, Q.Dequeue());
      }

      [TestMethod]
      public void QueueOverflowTest()
      {
      CyclicQueue Q = new CyclicQueue(5);
      Q.Enqueue(1);
      Q.Enqueue(2);
      Q.Enqueue(3);
      Q.Enqueue(4);
      Q.Enqueue(5);
      Assert.AreEqual(1, Q.Dequeue());
      Q.Enqueue(6);
      Assert.AreEqual(2, Q.Front);
      Assert.AreEqual(6, Q.Rear);
      }
      }

      public class CyclicQueue
      {
      public int[] _buffer;
      private int _start;
      private int _end;
      private int _size;
      private int _maxSize;
      public CyclicQueue(int maxSize)
      {
      _maxSize = maxSize;
      _buffer = new int[_maxSize];
      _start = 0;
      _end = 0;
      }
      public void Enqueue(int newValue)
      {
      if (_size == _maxSize)
      {
      throw new OutOfMemoryException("Queue at full capacity");
      }
      if (_size > 0)
      {
      _end = (_end + 1) % _maxSize;
      }
      _buffer[_end] = newValue;
      _size++;
      }

      public int Dequeue()
      {
      if (_size == 0)
      {
      throw new IndexOutOfRangeException("Queue is empty");
      }

      int result = _buffer[_start];
      _size--;

      _start = (_start + 1) % _maxSize;
      return result;
      }
      public int Front
      {
      get { return _buffer[_start]; }
      }

      public int Rear
      {
      get { return _buffer[_end]; }
      }
      }
      }






      c# interview-questions queue circular-list






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 hours ago









      200_success

      132k20159425




      132k20159425










      asked 6 hours ago









      GiladGilad

      1,44731635




      1,44731635






















          1 Answer
          1






          active

          oldest

          votes


















          4












          $begingroup$

          Yay exceptions!



          Though it isn't reservered for execution-ending errors, I would avoid throwing an OutOfMemoryException, because usually it signals something very inconvient indeed. IndexOutOfRangeException also seems inappropriate: I would probably use InvalidOperationException in both Enqueue and Dequeue.



          The constructor could do with a check to ensure maxSize is positive, so that it doesn't throw with a cryptic error.



          Front and End don't throw on an empty buffer, and probably should.



          API and Encapsulation



          There is no reason this class couldn't be generic: I would make it so. Indeed, because it stores ints at the moment, it would not be clear to a consumer looking at the members that Front and Rear return elements rather than indexes.



          I'd expect a Count => _size property, so that the Queue can be used for the sort of things Queues tend to be used (e.g. in your previous questions).



          Do you have a particular use-case in mind for exposing _buffer? What good can come of this? There is no information made available as to the content of the buffer, so it can't be used for anything because nothing except the CyclicQueue knows how to use it. I would strongly suggest making this private (also, if it is public, it should ideally following the ProperCamelCase naming conventions like your other public members).



          Since this is a non-resizing queue, the MaxSize probably ought to be public information. I'd also consider making it MaxSize => _buffer.Length to reduce redundancy. You could also make _buffer readonly to signal it's not meant to be changed to the maintainers.



          Correctness



          I'm not sure the _size > 0 check in Enqueue works. Consider a sequence of Enqueue, (Dequeue, Enqueue)*n on a newly created CyclicQueue: this will leave _end = 0 while _start is incremented. I think this can be resolved by setting _end = _maxSize - 1 in the constructor and removing the check.



          Misc/Boring Stuff




          • You could do with a little more white-space between things... at the very least, be consistent with your between-member spacing.


          • You could do with tests which test the exceptions (i.e. checking it throws if you try to enqueue/dequeue too many things.


          • As always, inline-documentation would be appreciated. This should describe the non-resizing nature of the queue, when it throws exceptions, and resolve the confusion concerning whether Front is an index or element.







          share|improve this answer









          $endgroup$













          • $begingroup$
            I always like and appreciate your reviews! Thanks again
            $endgroup$
            – Gilad
            4 hours ago












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "196"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f219887%2fcyclic-queue-using-an-array-in-c%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4












          $begingroup$

          Yay exceptions!



          Though it isn't reservered for execution-ending errors, I would avoid throwing an OutOfMemoryException, because usually it signals something very inconvient indeed. IndexOutOfRangeException also seems inappropriate: I would probably use InvalidOperationException in both Enqueue and Dequeue.



          The constructor could do with a check to ensure maxSize is positive, so that it doesn't throw with a cryptic error.



          Front and End don't throw on an empty buffer, and probably should.



          API and Encapsulation



          There is no reason this class couldn't be generic: I would make it so. Indeed, because it stores ints at the moment, it would not be clear to a consumer looking at the members that Front and Rear return elements rather than indexes.



          I'd expect a Count => _size property, so that the Queue can be used for the sort of things Queues tend to be used (e.g. in your previous questions).



          Do you have a particular use-case in mind for exposing _buffer? What good can come of this? There is no information made available as to the content of the buffer, so it can't be used for anything because nothing except the CyclicQueue knows how to use it. I would strongly suggest making this private (also, if it is public, it should ideally following the ProperCamelCase naming conventions like your other public members).



          Since this is a non-resizing queue, the MaxSize probably ought to be public information. I'd also consider making it MaxSize => _buffer.Length to reduce redundancy. You could also make _buffer readonly to signal it's not meant to be changed to the maintainers.



          Correctness



          I'm not sure the _size > 0 check in Enqueue works. Consider a sequence of Enqueue, (Dequeue, Enqueue)*n on a newly created CyclicQueue: this will leave _end = 0 while _start is incremented. I think this can be resolved by setting _end = _maxSize - 1 in the constructor and removing the check.



          Misc/Boring Stuff




          • You could do with a little more white-space between things... at the very least, be consistent with your between-member spacing.


          • You could do with tests which test the exceptions (i.e. checking it throws if you try to enqueue/dequeue too many things.


          • As always, inline-documentation would be appreciated. This should describe the non-resizing nature of the queue, when it throws exceptions, and resolve the confusion concerning whether Front is an index or element.







          share|improve this answer









          $endgroup$













          • $begingroup$
            I always like and appreciate your reviews! Thanks again
            $endgroup$
            – Gilad
            4 hours ago
















          4












          $begingroup$

          Yay exceptions!



          Though it isn't reservered for execution-ending errors, I would avoid throwing an OutOfMemoryException, because usually it signals something very inconvient indeed. IndexOutOfRangeException also seems inappropriate: I would probably use InvalidOperationException in both Enqueue and Dequeue.



          The constructor could do with a check to ensure maxSize is positive, so that it doesn't throw with a cryptic error.



          Front and End don't throw on an empty buffer, and probably should.



          API and Encapsulation



          There is no reason this class couldn't be generic: I would make it so. Indeed, because it stores ints at the moment, it would not be clear to a consumer looking at the members that Front and Rear return elements rather than indexes.



          I'd expect a Count => _size property, so that the Queue can be used for the sort of things Queues tend to be used (e.g. in your previous questions).



          Do you have a particular use-case in mind for exposing _buffer? What good can come of this? There is no information made available as to the content of the buffer, so it can't be used for anything because nothing except the CyclicQueue knows how to use it. I would strongly suggest making this private (also, if it is public, it should ideally following the ProperCamelCase naming conventions like your other public members).



          Since this is a non-resizing queue, the MaxSize probably ought to be public information. I'd also consider making it MaxSize => _buffer.Length to reduce redundancy. You could also make _buffer readonly to signal it's not meant to be changed to the maintainers.



          Correctness



          I'm not sure the _size > 0 check in Enqueue works. Consider a sequence of Enqueue, (Dequeue, Enqueue)*n on a newly created CyclicQueue: this will leave _end = 0 while _start is incremented. I think this can be resolved by setting _end = _maxSize - 1 in the constructor and removing the check.



          Misc/Boring Stuff




          • You could do with a little more white-space between things... at the very least, be consistent with your between-member spacing.


          • You could do with tests which test the exceptions (i.e. checking it throws if you try to enqueue/dequeue too many things.


          • As always, inline-documentation would be appreciated. This should describe the non-resizing nature of the queue, when it throws exceptions, and resolve the confusion concerning whether Front is an index or element.







          share|improve this answer









          $endgroup$













          • $begingroup$
            I always like and appreciate your reviews! Thanks again
            $endgroup$
            – Gilad
            4 hours ago














          4












          4








          4





          $begingroup$

          Yay exceptions!



          Though it isn't reservered for execution-ending errors, I would avoid throwing an OutOfMemoryException, because usually it signals something very inconvient indeed. IndexOutOfRangeException also seems inappropriate: I would probably use InvalidOperationException in both Enqueue and Dequeue.



          The constructor could do with a check to ensure maxSize is positive, so that it doesn't throw with a cryptic error.



          Front and End don't throw on an empty buffer, and probably should.



          API and Encapsulation



          There is no reason this class couldn't be generic: I would make it so. Indeed, because it stores ints at the moment, it would not be clear to a consumer looking at the members that Front and Rear return elements rather than indexes.



          I'd expect a Count => _size property, so that the Queue can be used for the sort of things Queues tend to be used (e.g. in your previous questions).



          Do you have a particular use-case in mind for exposing _buffer? What good can come of this? There is no information made available as to the content of the buffer, so it can't be used for anything because nothing except the CyclicQueue knows how to use it. I would strongly suggest making this private (also, if it is public, it should ideally following the ProperCamelCase naming conventions like your other public members).



          Since this is a non-resizing queue, the MaxSize probably ought to be public information. I'd also consider making it MaxSize => _buffer.Length to reduce redundancy. You could also make _buffer readonly to signal it's not meant to be changed to the maintainers.



          Correctness



          I'm not sure the _size > 0 check in Enqueue works. Consider a sequence of Enqueue, (Dequeue, Enqueue)*n on a newly created CyclicQueue: this will leave _end = 0 while _start is incremented. I think this can be resolved by setting _end = _maxSize - 1 in the constructor and removing the check.



          Misc/Boring Stuff




          • You could do with a little more white-space between things... at the very least, be consistent with your between-member spacing.


          • You could do with tests which test the exceptions (i.e. checking it throws if you try to enqueue/dequeue too many things.


          • As always, inline-documentation would be appreciated. This should describe the non-resizing nature of the queue, when it throws exceptions, and resolve the confusion concerning whether Front is an index or element.







          share|improve this answer









          $endgroup$



          Yay exceptions!



          Though it isn't reservered for execution-ending errors, I would avoid throwing an OutOfMemoryException, because usually it signals something very inconvient indeed. IndexOutOfRangeException also seems inappropriate: I would probably use InvalidOperationException in both Enqueue and Dequeue.



          The constructor could do with a check to ensure maxSize is positive, so that it doesn't throw with a cryptic error.



          Front and End don't throw on an empty buffer, and probably should.



          API and Encapsulation



          There is no reason this class couldn't be generic: I would make it so. Indeed, because it stores ints at the moment, it would not be clear to a consumer looking at the members that Front and Rear return elements rather than indexes.



          I'd expect a Count => _size property, so that the Queue can be used for the sort of things Queues tend to be used (e.g. in your previous questions).



          Do you have a particular use-case in mind for exposing _buffer? What good can come of this? There is no information made available as to the content of the buffer, so it can't be used for anything because nothing except the CyclicQueue knows how to use it. I would strongly suggest making this private (also, if it is public, it should ideally following the ProperCamelCase naming conventions like your other public members).



          Since this is a non-resizing queue, the MaxSize probably ought to be public information. I'd also consider making it MaxSize => _buffer.Length to reduce redundancy. You could also make _buffer readonly to signal it's not meant to be changed to the maintainers.



          Correctness



          I'm not sure the _size > 0 check in Enqueue works. Consider a sequence of Enqueue, (Dequeue, Enqueue)*n on a newly created CyclicQueue: this will leave _end = 0 while _start is incremented. I think this can be resolved by setting _end = _maxSize - 1 in the constructor and removing the check.



          Misc/Boring Stuff




          • You could do with a little more white-space between things... at the very least, be consistent with your between-member spacing.


          • You could do with tests which test the exceptions (i.e. checking it throws if you try to enqueue/dequeue too many things.


          • As always, inline-documentation would be appreciated. This should describe the non-resizing nature of the queue, when it throws exceptions, and resolve the confusion concerning whether Front is an index or element.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 5 hours ago









          VisualMelonVisualMelon

          4,0921227




          4,0921227












          • $begingroup$
            I always like and appreciate your reviews! Thanks again
            $endgroup$
            – Gilad
            4 hours ago


















          • $begingroup$
            I always like and appreciate your reviews! Thanks again
            $endgroup$
            – Gilad
            4 hours ago
















          $begingroup$
          I always like and appreciate your reviews! Thanks again
          $endgroup$
          – Gilad
          4 hours ago




          $begingroup$
          I always like and appreciate your reviews! Thanks again
          $endgroup$
          – Gilad
          4 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Code Review Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f219887%2fcyclic-queue-using-an-array-in-c%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...