Inserting, removing, accessing, modifying, by index, on linked list

未關閉
#835 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

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

研究方向

Start by locating the linked-list implementation and reviewing its existing public operations. Confirm whether Insert, Remove, Get, and Set fit the current API, then add the agreed operations with behavior matching the stated preconditions and postconditions.

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

描述

Insert(head, index, value)
Pre: head is the head node in the list
Post: the list at the new index is the value; all items in the list are shifted up one index (trivial in a linked list).

Remove(head, index)
Pre: head is the head node in the list
Post: the item at the index is returned; all items after that index are shifted down one index (trivial in a linked list).

Get(head, index)
Pre: head is the head node in the list
Post: the item at the index is returned.

Set(head, index, value)
Pre: head is the head node in the list
Post: the previous item at the index is returned; the index now holds the new value

These seem like important features to be in a list. Should we add these? (Also, I'm kinda new to contributing; should these 4 functions be separate issues, or are they related enough that they make sense as one issue?)

主要語言
JavaScript
星號
197k
分支
31k
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

trekhleb/javascript-algorithms 的其他 Issue

查看 trekhleb/javascript-algorithms 的全部 Issue

相似的 Issue

更多 JavaScript Issue

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

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