{"id":34274742,"url":"https://github.com/cforth/toys","last_synced_at":"2025-12-16T20:59:52.366Z","repository":{"id":22956278,"uuid":"26305964","full_name":"cforth/toys","owner":"cforth","description":"算法与数据结构练习（主要是Python3）。","archived":false,"fork":false,"pushed_at":"2016-03-16T06:23:58.000Z","size":141,"stargazers_count":101,"open_issues_count":0,"forks_count":40,"subscribers_count":10,"default_branch":"master","last_synced_at":"2023-11-07T17:17:29.612Z","etag":null,"topics":["python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cforth.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}},"created_at":"2014-11-07T05:53:24.000Z","updated_at":"2023-09-08T16:51:58.000Z","dependencies_parsed_at":"2022-08-05T20:30:26.552Z","dependency_job_id":null,"html_url":"https://github.com/cforth/toys","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/cforth/toys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cforth%2Ftoys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cforth%2Ftoys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cforth%2Ftoys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cforth%2Ftoys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cforth","download_url":"https://codeload.github.com/cforth/toys/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cforth%2Ftoys/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27771139,"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","status":"online","status_checked_at":"2025-12-16T02:00:10.477Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["python3"],"created_at":"2025-12-16T20:59:51.734Z","updated_at":"2025-12-16T20:59:52.348Z","avatar_url":"https://github.com/cforth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"算法与数据结构练习（Python3）\n=====\n\n作者:Chai Fei   \nE-mail:cforth [at] cfxyz.com  \n主要是Python写的算法与数据结构练习代码，还有《计算的本质：深入剖析程序和计算机》这本书中的演示代码。书中是Ruby语言实现的，我改写成了Python语言实现。\n\n\ncombinations\n------------\n数学中的组合、排列、枚举算法的演示代码。以及我设计的一种多进制数算术系统的实现。  \n1. [集合中所有组合的生成算法](https://github.com/cforth/toys/blob/master/combinations/combinations_generater.py)  \n2. [集合中所有排列的生成算法](https://github.com/cforth/toys/blob/master/combinations/permutations_generater.py)  \n3. [集合中所有枚举的生成算法](https://github.com/cforth/toys/blob/master/combinations/enumerations_generater.py)  \n4. [多进制数算术系统的实现](https://github.com/cforth/toys/blob/master/combinations/MultiInt.py)\n\n\nsort\n------------\n常用的排序算法的演示代码。  \n1. [选择排序算法](https://github.com/cforth/toys/blob/master/sort/selection_sort.py)  \n2. [插入排序算法](https://github.com/cforth/toys/blob/master/sort/insertion_sort.py)  \n3. [希尔排序算法](https://github.com/cforth/toys/blob/master/sort/shell_sort.py)  \n4. [合并排序算法](https://github.com/cforth/toys/blob/master/sort/merge_sort.py)  \n5. [堆排序算法](https://github.com/cforth/toys/blob/master/sort/heap_sort.py)  \n6. [快速排序算法](https://github.com/cforth/toys/blob/master/sort/quick_sort.py)  \n7. [计数排序算法](https://github.com/cforth/toys/blob/master/sort/counting_sort.py)  \n8. [基数排序算法](https://github.com/cforth/toys/blob/master/sort/radix_sort.py)  \n\ngraphs\n-------------\n图的数据结构与算法。  \n1. [无向图的邻接列表表示](https://github.com/cforth/toys/blob/master/graphs/undirected_graphs.py)    \n2. [深度优先算法](https://github.com/cforth/toys/blob/master/graphs/depth_first_search.py)   \n3. [深度优先路径查询](https://github.com/cforth/toys/blob/master/graphs/depth_first_paths.py)  \n\nsearch\n-------------\n常用的搜索算法的演示代码。  \n1. [二叉搜索树的实现](https://github.com/cforth/toys/blob/master/search/binary_search_tree.py)  \n2. [深度与广度优先遍历](https://github.com/cforth/toys/blob/master/search/tree_ergodic.py)\n\n\nsearch/print_tree\n-------------\n一个外国牛人写的[小工具](https://github.com/cforth/toys/tree/master/search/print_tree)，打印出树结构图（C语言）。\n\n\nSimple\n-------------\n[《计算的本质：深入剖析程序和计算机》](http://www.ituring.com.cn/book/1098)中第二章的Simple语言实现。  \n1. [小步操作语义-表达式](https://github.com/cforth/toys/blob/master/Simple/Machine2.3.1-1.py)    \n2. [小步操作语义-语句](https://github.com/cforth/toys/blob/master/Simple/Machine2.3.1-2.py)   \n3. [大步操作语义](https://github.com/cforth/toys/blob/master/Simple/Evaluate2.3.2.py)  \n4. [指称语义](https://github.com/cforth/toys/blob/master/Simple/Denotation2.4.py)\n\n\nAutomaton\n-------------\n[《计算的本质：深入剖析程序和计算机》](http://www.ituring.com.cn/book/1098)中第三章以及第四章的自动机实现。  \n1. [确定性有限自动机（Deterministic Finite Automaton，DFA）](https://github.com/cforth/toys/blob/master/Automaton/DFA3.1.py)  \n2. [非确定性有限自动机（Nondeterministic Finite Automata，NFA）](https://github.com/cforth/toys/blob/master/Automaton/NFA3.2.py)  \n3. [正则表达式的实现](https://github.com/cforth/toys/blob/master/Automaton/Pattern3.3.py)  \n4. [NFA与DFA的等价性](https://github.com/cforth/toys/blob/master/Automaton/NFASimulation3.4.py)  \n5. [确定性下推自动机（Deterministic PushDown Automaton，DPDA）](https://github.com/cforth/toys/blob/master/Automaton/DPDA4.1.py)  \n6. [非确定性下推自动机（Nondeterministic Pushdown Automaton，NPDA）](https://github.com/cforth/toys/blob/master/Automaton/NPDA4.2.py)  \n7. [词法分析（Lexical Analyzer）](https://github.com/cforth/toys/blob/master/Automaton/LexicalAnalyzer4.3.1.py)  \n8. [语法分析（Grammar Analyzer）](https://github.com/cforth/toys/blob/master/Automaton/GrammarAnalyzer4.3.2.py)\n\n\nTuring\n-------------\n[《计算的本质：深入剖析程序和计算机》](http://www.ituring.com.cn/book/1098)中第五章的图灵机实现。   \n1. [确定型图灵机（Deterministic Turing Machine，DTM）](https://github.com/cforth/toys/blob/master/Turing/DTM.py)    \n\n\nLambdaCalculus\n---------------\n[《计算的本质：深入剖析程序和计算机》](http://www.ituring.com.cn/book/1098)中第六章、第七章的Lambda演算实现。   \n1. [模拟lambda演算](https://github.com/cforth/toys/blob/master/LambdaCalculus/lambda6.1.py)    \n2. [FizzBuzz游戏(0-50)](https://github.com/cforth/toys/blob/master/LambdaCalculus/FizzBuzz.py)  \n3. [lambda演算](https://github.com/cforth/toys/blob/master/LambdaCalculus/LambdaCalculus7.1.py)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcforth%2Ftoys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcforth%2Ftoys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcforth%2Ftoys/lists"}