{"id":15032336,"url":"https://github.com/knightsj/awesome-algorithm-question-solution","last_synced_at":"2025-05-16T12:12:39.396Z","repository":{"id":44567000,"uuid":"128767020","full_name":"knightsj/awesome-algorithm-question-solution","owner":"knightsj","description":"LeetCode，《剑指offer》中的算法题的题目和解法以及常见算法的实现","archived":false,"fork":false,"pushed_at":"2023-03-10T08:20:48.000Z","size":891,"stargazers_count":1137,"open_issues_count":12,"forks_count":242,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-05-05T14:08:55.673Z","etag":null,"topics":["algorithm","interview","interview-questions","leetcode","solution"],"latest_commit_sha":null,"homepage":"","language":"C++","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/knightsj.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}},"created_at":"2018-04-09T12:18:25.000Z","updated_at":"2025-04-30T06:42:49.000Z","dependencies_parsed_at":"2022-09-25T00:23:00.819Z","dependency_job_id":"65bd617c-1299-449e-9b7d-aa06630310b2","html_url":"https://github.com/knightsj/awesome-algorithm-question-solution","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/knightsj%2Fawesome-algorithm-question-solution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightsj%2Fawesome-algorithm-question-solution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightsj%2Fawesome-algorithm-question-solution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knightsj%2Fawesome-algorithm-question-solution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knightsj","download_url":"https://codeload.github.com/knightsj/awesome-algorithm-question-solution/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253650920,"owners_count":21942230,"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","interview","interview-questions","leetcode","solution"],"created_at":"2024-09-24T20:18:04.444Z","updated_at":"2025-05-16T12:12:39.340Z","avatar_url":"https://github.com/knightsj.png","language":"C++","readme":"![](res/header.png)\n\n\n\n![](https://img.shields.io/badge/language-C%2B%2B-F14E7E.svg) \n![](https://img.shields.io/badge/language-Java-B07319.svg)\n![](https://img.shields.io/badge/language-Swift-ffac45.svg)\n ![](https://img.shields.io/badge/judgement-passing-brightgreen.svg)\n\n\n# Introduction\n\nLeetCode \u0026《剑指offer》中的算法题的题目和解法 \u0026 常见算法的实现\n\n\n# Chapters\n\n## 1. Math  Implementation Questions（数学实现题）\n\n\n\n[1.1 Fibonacci Implementation（斐波那契数列实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.1%20Fibonacci%20Implementation)\n\n[1.2 Binary Search（二分查找）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.2%20Binary%20Search)\n\n[1.3 Is Prime（是否是质数）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.3%20Is%20Prime)\n\n[1.4 Is Ugly Number（是否是丑数）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.4%20Is%20Ugly%20Number)\n\n[1.5 Is Power Of Two（是否是2的幂）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.5%20Is%20Power%20Of%20Two)\n\n[1.6 Is Power Of Three（是否是3的幂）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.6%20Is%20Power%20Of%20Three)\n\n[1.7 Count Primes（质数的个数）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B1%5D.%20Math%20Implementation/1.7%20Count%20Primes)\n\n\n\n\n\n## 2. Algorithm Implementation Questions (算法实现题)\n\n[2.0 Sort Test Demo（排序测试用例）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.0%20Sort%20Test%20Demo)\n\n[2.1 Bubble Sort Implementation（冒泡排序实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.1%20Bubble%20Sort%20Implementation)\n\n[2.2 Selection Sort Implementation（选择排序实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.2%20Selection%20Sort%20Implementation)\n\n[2.3 Insertion Sort Implementation（插入排序实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.3%20Insertion%20Sort%20Implementation)\n\n[2.4 Quick Sort Implementation（快速排序实现）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B2%5D.%20Algorithm%20Implementation/2.4%20Quick%20Sort%20Implementation)\n\n\n\n\n\n## 3. Linked List Questions（链表相关问题）\n\n[3.0 Linked List Test Demo（链表类，测试用例）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.0%20Linked%20List%20Test%20Demo)\n\n[3.1 Linked List Cycle（链表是否有环）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.1%20Linked%20List%20Cycle)\n\n[3.2 Intersection Of Two Linked Lists（两个链表的交点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.2%20Intersection%20Of%20Two%20Linked%20Lists)\n\n [3.3 Reverse Linked List（反转链表）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.3%20Reverse%20Linked%20List)\n\n[3.4 Merge Two Linked Lists（合并两个链表）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.4%20Merge%20Two%20Linked%20Lists)\n\n[3.5 Find the Kth to tail in Linked List（找到链表的倒数第K个节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.5%20Find%20the%20Kth%20to%20tail%20in%20Linked%20List)\n\n[3.6 Recursively Print Linked List（倒序打印链表）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.6%20Recursively%20Print%20Linked%20List%20)\n\n[3.7 Remove Nth From End Of Linkded List（删除链表倒数第N个节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.7%20Remove%20Nth%20From%20End%20Of%20Linkded%20List)\n\n[3.8 Delete Node in a Linked List（删除链表里某个节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.8%20Delete%20Node%20in%20a%20Linked%20List/)\n\n[3.9 Remove Duplicates I（删除链表内重复的节点，保留单个节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.9%20Remove%20Duplicates%20I)\n\n[3.10 Remove Duplicates II（删除链表内所有重复的节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.10%20Remove%20Duplicates%20II)\n\n[3.11 Remove Linked List Elements（删除链表里某个值的所有节点）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.11%20Remove%20Linked%20List%20Elements)\n\n[3.12 Partition Linked List（左右临界值分离）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.12%20Partition%20Linked%20List)\n\n[3.13 Old Even List（左右奇偶index的值分离）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B3%5D.%20Linked%20List/3.13%20Old%20Evem%20List)\n\n\n\n## 4. Array Questions（数组相关问题）\n\n[4.0 Array Test Demo](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.0%20Array%20Test%20demo)\n\n[4.1 Contains Duplicate I（检测数组中是否包含重复的元素）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.1%20Contains%20Duplicate%20I)\n\n[4.2 Majority Element（出现次数超过数组长度一半的元素）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.2%20Majority%20Element)\n\n[4.3 Single Number（数组中只出现过一次的数字）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.3%20Single%20Number)\n\n[4.4 Missing Number (寻找数组中缺失的数字)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.4%20Missing%20Number)\n\n[4.5 Move Zeros (将所有的0移动到数组末尾)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.5%20Move%20Zeros)\n\n[4.6 Remove Element (移除数组中等于某个值的元素)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.6%20Remove%20Element)\n\n[4.7 Sort Colors（三色旗问题）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.7%20Sort%20Colors)\n\n[4.8 Two Sum II（有序数组内部的两个元素的和为目标值）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.8%20Two%20Sum%20II)\n\n[4.9 Minimum Sub Array Sum（无序数组和大于或等于某值的最小子数组）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.9%20Minimum%20Sub%20Array%20Sum)\n\n[4.10 Intersection of Two Arrays（两个数组的交点元素）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.10%20Intersection%20of%20Two%20Arrays)\n\n[4.11 The Top Kth Frequent Element  (出现频率最高的第k个元素)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.11%20The%20Top%20Kth%20Frequent%20Element )\n\n[4.12 The Kth Largest Element(数组中第k大的元素)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.12%20The%20Kth%20Largest%20Element)\n\n[4.13 Merge Two Sorted Array (合并两个有序的数组)](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.13%20Merge%20Two%20Sorted%20Array)\n\n[4.14 Two Sum I（无序数组内部的两个元素的和为目标值）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B4%5D.%20Array/4.14%20Two%20Sum%20I)\n\n\n\n\n\n## 5. Binary Tree Questions（二叉树相关问题）\n\n\n\n[5.1 Maximum Depth of Binary Tree（二叉树的深度）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.1%20Maximum%20Depth%20Of%20Binary%20Tree)\n\n[5.2 Invert Binary Tree（反转二叉树）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.2%20Invert%20Binary%20Tree)\n\n[5.3 Balanced Binary Tree（是否是平衡二叉树）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.3%20Balanced%20Binary%20Tree)\n\n[5.4 Symmetric Tree（是否是镜像树）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.4%20Symmetric%20Tree)\n\n[5.5 Is Same Tree（树是否相等）](https://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B5%5D.%20Tree/5.5%20Is%20Same%20Tree)\n\n\n\n\n\n## 6. String Questions（字符串相关问题）\n\n[6.1 Reverse String（反转字符串）](\u003chttps://github.com/knightsj/awesome-algorithm-question-solution/tree/master/%5B6%5D.%20String/6.1%20Reverse%20String\u003e)\n\n\n\n\n\n\n\n\n\n\n\n# License\n\nThis repositorie is released under the under [MIT License](https://github.com/knightsj/awesome-algorithm-question-solution/blob/master/LICENSE)\n\n","funding_links":[],"categories":["C/C++"],"sub_categories":["3. Course and Code"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightsj%2Fawesome-algorithm-question-solution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknightsj%2Fawesome-algorithm-question-solution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightsj%2Fawesome-algorithm-question-solution/lists"}