Skip to content
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

#16 Underwater Queue Waving #19

Open
somekindofwallflower opened this issue Jun 14, 2022 · 0 comments
Open

#16 Underwater Queue Waving #19

somekindofwallflower opened this issue Jun 14, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@somekindofwallflower
Copy link
Owner

Description

  1. Complete the task in weave/queue.js
  2. Implement the 'weave' function. Weave
    receives two queues as arguments and combines the
    contents of each into a new, third queue.
    The third queue should contain the alterating content
    of the two queues. The function should handle
    queues of different lengths without inserting
    'undefined' into the new one.
    Do not access the array inside of any queue, only
    use the 'add', 'remove', and 'peek' functions.

Example
const queueOne = new Queue();
queueOne.add(1);
queueOne.add(2);
const queueTwo = new Queue();
queueTwo.add('Hi');
queueTwo.add('There');
const q = weave(queueOne, queueTwo);
q.remove() // 1
q.remove() // 'Hi'
q.remove() // 2
q.remove() // 'There'

@somekindofwallflower somekindofwallflower self-assigned this Jun 14, 2022
@somekindofwallflower somekindofwallflower added the enhancement New feature or request label Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant