{"id":21806256,"url":"https://github.com/daya-jin/datastructureandalgorithm","last_synced_at":"2026-04-11T20:46:17.109Z","repository":{"id":242657436,"uuid":"165510991","full_name":"Daya-Jin/DataStructureAndAlgorithm","owner":"Daya-Jin","description":"Implementations of commonly data structure and problem solving with Python","archived":false,"fork":false,"pushed_at":"2021-01-04T09:59:03.000Z","size":727,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-13T15:52:13.774Z","etag":null,"topics":["algorithms","data-structures"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/Daya-Jin.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,"zenodo":null}},"created_at":"2019-01-13T13:52:58.000Z","updated_at":"2021-09-14T09:22:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"5bf5b4d8-2b64-474a-a014-912992fedc14","html_url":"https://github.com/Daya-Jin/DataStructureAndAlgorithm","commit_stats":null,"previous_names":["daya-jin/datastructureandalgorithm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Daya-Jin/DataStructureAndAlgorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daya-Jin%2FDataStructureAndAlgorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daya-Jin%2FDataStructureAndAlgorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daya-Jin%2FDataStructureAndAlgorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daya-Jin%2FDataStructureAndAlgorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daya-Jin","download_url":"https://codeload.github.com/Daya-Jin/DataStructureAndAlgorithm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daya-Jin%2FDataStructureAndAlgorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31695165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T20:18:30.949Z","status":"ssl_error","status_checked_at":"2026-04-11T20:18:29.982Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algorithms","data-structures"],"created_at":"2024-11-27T12:18:46.312Z","updated_at":"2026-04-11T20:46:17.100Z","avatar_url":"https://github.com/Daya-Jin.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataStructureAndAlgorithm\n算法实现与刷题代码。文件夹计划分为两个：[BlankBoard](https://github.com/Daya-Jin/DataStructureAndAlgorithm/tree/master/BlankBoard)跟[OnlineExam](https://github.com/Daya-Jin/DataStructureAndAlgorithm/tree/master/OnlineExam)。前者要求是白板能徒手写出来的水平；而后者题意偏应用，主要针对在线笔试。\n\n## 题目思路套路及总结\n\n以下内容不分顺序。\n\n### DFS\n\n个人将DFS归为一种特殊的递归，大部分情况下DFS相当于暴力解，通过搜索问题的大部分子空间甚至所有子空间，根据根据符合题意的方向不断深入搜索。个人习惯使用的dfs函数有两个重要参数：```idx```与```path```，前者指示当前搜索的一个定位，后者表示从初始点到现在为止成功探索出来的路径。注意```path```不是```res```，但是可以看做是不完整的```res```，当满足条件时需要把```path```转成```res```或者加到```res```中去。\n\nDFS在递归调用时通常使用线性访问的顺序来避免访问重复地点。\n\n典型题目：[Combination Sum III](https://leetcode.com/problems/combination-sum-iii/)。\n\n### BFS\n\nBFS作为DFS的兄弟，同样是通过搜索问题子空间来得到解，不过个人习惯使用队列来实现BFS而不是递归。\n\n典型题目：[Friend Circles](https://leetcode.com/problems/friend-circles/)。\n\n### Bit Option\n\n题目中最常用的位操作不过于**与**、**异或**和**移位**三中操作。\n\n**与**操作常用于提取某一位的数字，跟$1$相与相当于提取最低位，跟$2$相与相当于提取倒数第$2$位，跟$3$相与相当于提取低两位，以此类推。\n\n**异或**操作常用来实现取反跟去重。跟$1$异或相当于取反，如$0\\oplus{1}=1$、$1\\oplus{1}=0$；去重的原理是因为任何数跟自身异或都等于$0$。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaya-jin%2Fdatastructureandalgorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaya-jin%2Fdatastructureandalgorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaya-jin%2Fdatastructureandalgorithm/lists"}