a-synchronous / a-synchronous/rubico

rubico/monad/Queue

未關閉
#147 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement good first issue help wanted
主要語言
JavaScript
星號
283
分支
17
PR 合併指標
30 天內沒有已合併 PR

描述

## Queue
the queue data structure

## synopsis
```coffeescript
new Queue(values Iterable|any) -> Queue {
map: function,
concat: function,
chain: function,
enqueue: function,
dequeue: function,
peek: function,
}
```

## description
A **Queue** is a data structure that supports `enqueue` and `dequeue` operations in O(1) time as well as monadic operations that enable iteration, concatenation, and flattening. Items pushed into a queue are first in first out (FIFO).

```javascript [playground]
const myQueue = new Queue([1, 2, 3])

console.log(myQueue) // Queue [3, 2, 1]

myQueue.enqueue(4)
myQueue.enqueue(5)
myQueue.enqueue(6)

console.log(myQueue) // Queue [6, 5, 4, 3, 2, 1]

console.log(myQueue.dequeue()) // 1
```

貢獻指南

開啟貢獻指南

研究方向

在程式碼庫中尋找 monad/Queue 模組,它可能位於名為 'monad' 的目錄中。Issue 指定要實作一個 Queue 資料結構,並提供 enqueue、dequeue、peek 和單子操作(map、concat、chain)。首先檢查現有的單子實作(如 Maybe、Either),以了解其模式。撰寫測試以驗證 O(1) 操作和 FIFO 行為。當 Queue 類別符合 synopsis 並通過所有測試時,即可完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
coffeescript, javascript
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。