{"id":18930864,"url":"https://github.com/onlymisaky/data-structures-algorithms-with-javascript","last_synced_at":"2026-03-17T02:30:16.830Z","repository":{"id":122393448,"uuid":"291891343","full_name":"onlymisaky/Data-Structures-Algorithms-with-JavaScript","owner":"onlymisaky","description":"数组结构与算法 JavaScript 描述","archived":false,"fork":false,"pushed_at":"2020-09-02T10:57:30.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T19:43:05.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onlymisaky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-01T03:59:37.000Z","updated_at":"2024-10-14T09:26:27.000Z","dependencies_parsed_at":"2024-07-09T14:15:16.508Z","dependency_job_id":null,"html_url":"https://github.com/onlymisaky/Data-Structures-Algorithms-with-JavaScript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlymisaky%2FData-Structures-Algorithms-with-JavaScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlymisaky%2FData-Structures-Algorithms-with-JavaScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlymisaky%2FData-Structures-Algorithms-with-JavaScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onlymisaky%2FData-Structures-Algorithms-with-JavaScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onlymisaky","download_url":"https://codeload.github.com/onlymisaky/Data-Structures-Algorithms-with-JavaScript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239927816,"owners_count":19719835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:39:19.769Z","updated_at":"2026-03-17T02:30:16.796Z","avatar_url":"https://github.com/onlymisaky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 数据结构与算法 JavaScript 描述\n\n## 链表(LinkedList)\n\n\u003e 链表是由一组节点组成的集合，每个节点都使用一个对象的引用指向它的后继，指向另一个节点的引用叫做链。\n\n不同于数组，链表中的元素在内存中并不是连续放置的。每个元素由一个存储元素本身的节点和一个指向下一个元素的引用(也称指针或链接)组成。\n\n对于传统的数组，链表的一个好处在于，添加或移除元素的时候不需要移动其他元素。然而，链表需要使用指针，因此实现链表时需要额外注意。\n\n数组的另一个细节是可以直接访问任何位置的任何元素，而要想访问链表中间的一个元素，需要从起点(表头)开始迭代列表直到找到所需的元素。\n\n### 单向链表(Singly LinkedList)\n[Singly LinkedList](https://github.com/onlymisaky/Data-Structures-Algorithms-with-JavaScript/blob/master/LinkedList/Singly/LinkedList.ts)\n\n\n### 双向链表(Doubly LinkedList)\n[Doubly LinkedList](https://github.com/onlymisaky/Data-Structures-Algorithms-with-JavaScript/blob/master/LinkedList/Doubly/LinkedList.ts)\n\n双向链表和普通链表的区别在于，在链表中，一个节点只有链向下一个节点的链接，而在双向链表中，链接是双向的.一个链向下一个元素，另一个链向前一个元素。\n\n双向链表提供了两种迭代列表的方法：从头到尾，或者反过来。我们也可以访问一个特定节点的下一个或前一个元素。在单向链表中，如果迭代列表时错过了要找的元素，就需要回到列表起点，重新开始迭代。这是双向链表的一个优点。\n\n### 循环链表(Circular LinkedList)\n[Circular LinkedList](https://github.com/onlymisaky/Data-Structures-Algorithms-with-JavaScript/blob/master/LinkedList/Circular/LinkedList.ts)\n[Circular LinkedList2](https://github.com/onlymisaky/Data-Structures-Algorithms-with-JavaScript/blob/master/LinkedList/Circular/LinkedList2.ts)\n\n\n循环链表可以像链表一样只有单向引用，也可以像双向链表一样有双向引用。循环链表和链表之间唯一的区别在于，最后一个元素指向下一个元素的指针(tail.next)不是引用null，而是指向第一个元素(head)。\n\n双向循环链表有指向head元素的tail.next，和指向tail元素的head.prev。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlymisaky%2Fdata-structures-algorithms-with-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonlymisaky%2Fdata-structures-algorithms-with-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonlymisaky%2Fdata-structures-algorithms-with-javascript/lists"}