Bugs, bugs, bugs: what to do when your queue code doesn't pass the tests?

  1. Make sure you implement queue_overwritePush() correctly. If the queue is full, pop an element and push the new element on the queue. If it is not full, just push the new value.
  2. For those of you using the extra “empty space” in the queue to determine full/empty, make sure that you allocate one additional location of memory in queue_init(), e.g., a queue of size 4 must be allocated with 5 locations. the code that I provide does this. However, this does not apply to students who are using elementCount to determine full/empty.
  3. Make sure that your pointers are initialized so that they point at memory provided by malloc().