a-synchronous / a-synchronous/rubico
rubico/monad/Stack
- 主要語言
- JavaScript
- 星號
- 283
- 分支
- 17
- PR 合併指標
- 30 天內沒有已合併 PR
描述
## Stack
the stack data structure
## synopsis
```coffeescript
new Stack(values Iterable|any) -> Stack {
map: function,
concat: function,
chain: function,
push: function,
pop: function,
top: function,
}
```
## description
A **Stack** is a data structure that supports `push` and `pop` operations in O(1) time as well as monadic operations that enable iteration, concatenation, and flattening. Items pushed onto a stack are first in last out (FILO).
```javascript [playground]
const myStack = new Stack([1, 2, 3])
console.log(myStack) // Stack [1, 2, 3]
myStack.push(4)
myStack.push(5)
myStack.push(6)
console.log(myStack) // Stack [1, 2, 3, 4, 5, 6]
console.log(myStack.pop()) // 6
```
貢獻指南
研究方向
在原始碼樹中尋找 monad/Stack.js 檔案或類似檔案。此 issue 定義了 API:實作一個包含 push、pop、top、map、concat 和 chain 方法的 Stack 類別。先閱讀專案中現有的 monad 實作,以了解其模式。撰寫測試以驗證 push/pop 的 O(1) 複雜度和單子行為。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript
- Issue 類型
- 功能
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 55/100