{"id":23293731,"url":"https://github.com/bestgopher/fucker","last_synced_at":"2025-04-06T18:49:01.502Z","repository":{"id":52835255,"uuid":"343417286","full_name":"bestgopher/fucker","owner":"bestgopher","description":"Some common data structures and algorigthms implemented by golang. For learning.","archived":false,"fork":false,"pushed_at":"2024-10-22T06:40:31.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T20:00:04.222Z","etag":null,"topics":["algorithm","algorithms-and-data-structures","avl-tree","bst-tree","go","golang","kmp","lru-cache","sort","sorting-algorithms","tree"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bestgopher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-03-01T12:59:23.000Z","updated_at":"2024-10-22T06:40:35.000Z","dependencies_parsed_at":"2024-12-20T06:17:20.309Z","dependency_job_id":"7a277a3d-664e-4c65-9d05-613262aa266e","html_url":"https://github.com/bestgopher/fucker","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestgopher%2Ffucker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestgopher%2Ffucker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestgopher%2Ffucker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestgopher%2Ffucker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bestgopher","download_url":"https://codeload.github.com/bestgopher/fucker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535489,"owners_count":20954574,"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":["algorithm","algorithms-and-data-structures","avl-tree","bst-tree","go","golang","kmp","lru-cache","sort","sorting-algorithms","tree"],"created_at":"2024-12-20T06:17:08.389Z","updated_at":"2025-04-06T18:49:01.479Z","avatar_url":"https://github.com/bestgopher.png","language":"Go","readme":"### fucker\n一些常见的数据结构与算法的golang实现。\n\n\n\n### 排序(sort)\n\n| 算法                                                         | 时间复杂度          | 空间复杂度 | 稳定性 |\n| ------------------------------------------------------------ | ------------------- | ---------- | ------ |\n| [Bubble](https://github.com/bestgopher/fucker/blob/master/sort/internal/bubble.go) | O( n^2 )            | O(1)       | yes    |\n| [Selection](https://github.com/bestgopher/fucker/blob/master/sort/internal/selection.go) | O( n^2 )            | O(1)       | no     |\n| [Heap](https://github.com/bestgopher/fucker/blob/master/sort/internal/heap.go) | O(nlogn)            | O(1)       | no     |\n| [Insertion](https://github.com/bestgopher/fucker/blob/master/sort/internal/insertion.go) | O(n^2)              | O(1)       | yes    |\n| [Merge](https://github.com/bestgopher/fucker/blob/master/sort/internal/merge.go) | O(nlogn)            | O(n)       | yes    |\n| [Quick](https://github.com/bestgopher/fucker/blob/master/sort/internal/quick.go) | O(nlogn)            | O(1)       | no     |\n| [Shell](https://github.com/bestgopher/fucker/blob/master/sort/internal/shell.go) | O(n^(4/3)) ~ O(n^2) | 取决于步长 | no     |\n\n- 概念\n\n  - 排序的稳定性(stability)\n\n     - 如果两个相等的元素，在排序前后的相对位置保持不变，那么这是稳定的排序算法。\n\n       ```\n       排序前：5 1 3(1) 4 7 3(2)\n       稳定的排序：1 3(1) 3(2) 4 5 7\n       稳定的排序：1 3(2) 3(1) 4 5 7\n       ```\n       \n       稳定的排序就是排序后第一个`3`还是在第二个`3`前面。如果两个`3`的相对次序交换了，则就不是稳定的排序。\n\n  - 原地算法(In-place Algorithm)\n\n     - 不依赖额外的资源或者依赖少数的额外资源，仅依靠输出来覆盖输入\n     - 空间复杂度为O(1)的都可以认为是原地算法\n\n### 树(tree)\n\n-  [二叉查找树(Binary Search Tree，BST树)](https://github.com/bestgopher/fucker/blob/master/tree/binary_search_tree.go)\n-  [二叉平衡查找树(AVL Tree)](https://github.com/bestgopher/fucker/blob/master/tree/avl_tree.go)\n-  [红黑树(Red-Black Tree)](https://github.com/bestgopher/fucker/blob/master/tree/red_black_tree.go)\n\n### 字符串查找算法(strs)\n-  [KMP算法](https://github.com/bestgopher/fucker/blob/master/strs/kmp.go)\n\n### 缓存(cache)\n\n- [最近最少使用(LRU)](https://github.com/bestgopher/fucker/blob/master/cache/lru.go)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestgopher%2Ffucker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbestgopher%2Ffucker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestgopher%2Ffucker/lists"}