Skip to content

Commit

Permalink
update List method defination
Browse files Browse the repository at this point in the history
  • Loading branch information
dxyinme committed Jan 19, 2024
1 parent 3ff9ae5 commit 22c743a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion list/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ type List[T any] interface {
// Append 在末尾追加元素
Append(ts ...T) error
// Add 在特定下标处增加一个新元素
// 如果下标超出范围,应该返回错误
// 如果下标不在[0, Len()]范围之内
// 应该返回错误
// 如果index == Len()则表示往List末端增加一个值
Add(index int, t T) error
// Set 重置 index 位置的值
// 如果下标超出范围,应该返回错误
Expand Down

0 comments on commit 22c743a

Please sign in to comment.