hello-algo icon indicating copy to clipboard operation
hello-algo copied to clipboard

data and memory中的部分意见

Open MeJerry215 opened this issue 1 year ago • 0 comments

关于此处char 的类型 在大多数语言中 是 char 可以看做是int8 所以 正常来说 符号是从 0-127表示的 ASICII码 而且是区分 unsigned 和 signed, 所以这里直接是2 bytes char 还有 默认是unsigned的 我是不认同的。

https://github.com/krahets/hello-algo/blob/7ca27c3df1bfc981fc7faa4528dadb410457d221/docs/chapter_data_structure/data_and_memory.md?plain=1#L24

还有此处没有将原码 反码 补码的情况下, 我认为在计算机中存储的就是补码。默认的整数在不区分unsigned 和signed 的情况下我更倾向于signed int32数据类型,则补码表示的负数 会比 正数多一个。

https://github.com/krahets/hello-algo/blob/7ca27c3df1bfc981fc7faa4528dadb410457d221/docs/chapter_data_structure/data_and_memory.md?plain=1#LL36C4-L36C65

MeJerry215 avatar May 11 '23 03:05 MeJerry215