Skip to content

[Bug] Day07 关于append的错误 #27

Description

@ZhengLiu-727

在day07最后一部分,1.5 append() 和 copy() 函数中,运行结果是错误的

正确结果如下

len=0 cap=0 slice=[]
len=1 cap=1 slice=[0]
len=2 cap=2 slice=[0 1]
len=6 cap=6 slice=[0 1 2 3 4 5]
len=6 cap=12 slice=[0 1 2 3 4 5]

建议在这里详细讲一下append的扩容

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions