{"action":"created","issue":{"url":"https://api.github.com/repos/LONGMIAOMIAO/Issues/issues/106","repository_url":"https://api.github.com/repos/LONGMIAOMIAO/Issues","labels_url":"https://api.github.com/repos/LONGMIAOMIAO/Issues/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/LONGMIAOMIAO/Issues/issues/106/comments","events_url":"https://api.github.com/repos/LONGMIAOMIAO/Issues/issues/106/events","html_url":"https://github.com/LONGMIAOMIAO/Issues/issues/106","id":319513212,"number":106,"title":"哈希表的时间复杂度为什么是O(1)","user":{"login":"LONGMIAOMIAO","id":17375822,"avatar_url":"https://avatars2.githubusercontent.com/u/17375822?v=4","gravatar_id":"","url":"https://api.github.com/users/LONGMIAOMIAO","html_url":"https://github.com/LONGMIAOMIAO","followers_url":"https://api.github.com/users/LONGMIAOMIAO/followers","following_url":"https://api.github.com/users/LONGMIAOMIAO/following{/other_user}","gists_url":"https://api.github.com/users/LONGMIAOMIAO/gists{/gist_id}","starred_url":"https://api.github.com/users/LONGMIAOMIAO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LONGMIAOMIAO/subscriptions","organizations_url":"https://api.github.com/users/LONGMIAOMIAO/orgs","repos_url":"https://api.github.com/users/LONGMIAOMIAO/repos","events_url":"https://api.github.com/users/LONGMIAOMIAO/events{/privacy}","received_events_url":"https://api.github.com/users/LONGMIAOMIAO/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-02T11:24:16Z","updated_at":"2018-05-02T11:25:21Z","closed_at":null,"author_association":"OWNER","body":"为什么数组的时间复杂度是O(1), 因为内存被设计成访问任一位置时间都是一样的, 而且非常块, 内存的大小对此并无影响.数组基于顺序的内存地址, 所以数组访问元素时间复杂度是O(1), 即数组的大小对此并无影响.哈希表的设计可以基于数组, 所以哈希表查询的平均时间复杂度为O(1).\r\n\r\n作者：匿名用户\r\n链接：https://www.zhihu.com/question/34039763/answer/151938728\r\n来源：知乎\r\n著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"},"comment":{"url":"https://api.github.com/repos/LONGMIAOMIAO/Issues/issues/comments/385945820","html_url":"https://github.com/LONGMIAOMIAO/Issues/issues/106#issuecomment-385945820","issue_url":"https://api.github.com/repos/LONGMIAOMIAO/Issues/issues/106","id":385945820,"user":{"login":"LONGMIAOMIAO","id":17375822,"avatar_url":"https://avatars2.githubusercontent.com/u/17375822?v=4","gravatar_id":"","url":"https://api.github.com/users/LONGMIAOMIAO","html_url":"https://github.com/LONGMIAOMIAO","followers_url":"https://api.github.com/users/LONGMIAOMIAO/followers","following_url":"https://api.github.com/users/LONGMIAOMIAO/following{/other_user}","gists_url":"https://api.github.com/users/LONGMIAOMIAO/gists{/gist_id}","starred_url":"https://api.github.com/users/LONGMIAOMIAO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LONGMIAOMIAO/subscriptions","organizations_url":"https://api.github.com/users/LONGMIAOMIAO/orgs","repos_url":"https://api.github.com/users/LONGMIAOMIAO/repos","events_url":"https://api.github.com/users/LONGMIAOMIAO/events{/privacy}","received_events_url":"https://api.github.com/users/LONGMIAOMIAO/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T11:25:21Z","updated_at":"2018-05-02T11:25:21Z","author_association":"OWNER","body":"数组的元素是基于顺序内存的, 4G内存从0开始排序, 直到2的32次方减1, 这看起来像不像一个数组? 其实因为内存的访问速度被设计成了访问内存任一位置的时间都是一样的! 如果不一样, 那么从头遍历的话, 内存靠前的地址岂不是比内存靠后的地址访问速度要快? (线性时间复杂度)这是不合理的!!!如果想直观感受一下, 可以看一看<<计算机系统要素>>这本书, 从nand门开始做实验."}}
{"actor":{"display_login":"LONGMIAOMIAO"}}