Skip to content

feat: Add circular queue data structure implementation #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

vcnovaes
Copy link
Contributor

@vcnovaes vcnovaes commented Oct 25, 2022

Addition of a queue data structure class

@vcnovaes vcnovaes changed the title Queue data structure implementation feat: Add queue data structure implementation Oct 25, 2022
* @function .length - returns the size of the qeuue
* @function .isEmpty - returns if the queue is empty
*/
/* queue data-structure. It's work is based on the LIFO method (last-IN-first-OUT).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clean up your comments here

- Making suggested changes
@vcnovaes
Copy link
Contributor Author

I choosed to use a circular array implementation of the queue, is this ok?

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an addition but rather a modification, which should ideally be its own class CircularQueue? It might implement the same Queue interface as the basic Queue.

@vcnovaes
Copy link
Contributor Author

I made the suggested changes, I think that an queue interface it makes more sense when other implementation of queue is added

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should extend the queue, not replace it by a circular queue.

@appgurueu appgurueu changed the title feat: Add queue data structure implementation feat: Add circular queue data structure implementation Oct 29, 2022
@@ -2,7 +2,13 @@
* @class CircularQueue
* @description Circular implementation of a queue
*/
export class CircularQueue<T> {
export interface Queue<T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. That way you still get rid of the non-circular Queue implementation. I want there to be two Queue classes, one circular and the other one not circular. They may both implement a common interface.

@zFl4wless
Copy link
Contributor

zFl4wless commented Mar 22, 2023

@appgurueu This PR can be closed. Implemented in #116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants