hello-algorithm
🌍 针对小白的算法训练 | 包括四部分:①.大厂面经 ②.力扣图解 ③.千本开源电子书 ④.百张技术思维导图(项目花了上百小时,希望可以点 star 支持,🌹感谢~)推荐免费ChatGPT使 用网站
Top Related Projects
《Hello 算法》:动画图解、一键运行的数据结构与算法教程。支持 Python, Java, C++, C, C#, JS, Go, Swift, Rust, Ruby, Kotlin, TS, Dart 代码。简体版和繁体版同步更新,English version ongoing
刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.
📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
All Algorithms implemented in Python
LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)
Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)
Quick Overview
The geekxh/hello-algorithm repository is a comprehensive resource for learning data structures and algorithms, primarily aimed at Chinese-speaking developers. It provides a collection of algorithm implementations, explanations, and learning materials, including e-books and interview preparation resources.
Pros
- Extensive coverage of various data structures and algorithms
- Includes visual explanations and illustrations for better understanding
- Offers free e-books and interview preparation materials
- Provides implementations in multiple programming languages
Cons
- Primarily in Chinese, which may limit accessibility for non-Chinese speakers
- Some sections may lack depth or detailed explanations
- Not frequently updated, with the last commit being over a year ago
- May not cover the most recent algorithmic developments or interview trends
Code Examples
As this is not a code library but rather a collection of algorithm implementations and learning resources, we'll skip the code examples section.
Getting Started
As this is not a code library, we'll skip the getting started instructions. However, users can access the repository's content by visiting the GitHub page and exploring the various folders and resources provided.
Competitor Comparisons
《Hello 算法》:动画图解、一键运行的数据结构与算法教程。支持 Python, Java, C++, C, C#, JS, Go, Swift, Rust, Ruby, Kotlin, TS, Dart 代码。简体版和繁体版同步更新,English version ongoing
Pros of hello-algo
- More comprehensive coverage of algorithms and data structures
- Cleaner and more organized repository structure
- Supports multiple programming languages (C++, Java, Python, etc.)
Cons of hello-algo
- Less focus on interview-specific problems
- Fewer visual aids and diagrams for explaining concepts
Code Comparison
hello-algorithm (Python):
def binary_search(arr, target):
left, right = 0, len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1
hello-algo (Python):
def binary_search(nums: List[int], target: int) -> int:
left, right = 0, len(nums) - 1
while left <= right:
mid = left + (right - left) // 2
if nums[mid] < target:
left = mid + 1
elif nums[mid] > target:
right = mid - 1
else:
return mid
return -1
Both repositories provide implementations of common algorithms and data structures. hello-algorithm focuses more on interview preparation and includes a wider range of topics, while hello-algo offers a more structured approach to learning algorithms with support for multiple programming languages. The code comparison shows similar implementations of binary search, with hello-algo using a slightly different method to calculate the midpoint to avoid potential integer overflow.
刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.
Pros of fucking-algorithm
- More comprehensive coverage of algorithm topics and problem-solving strategies
- In-depth explanations and detailed analysis of each algorithm
- Regular updates and active community engagement
Cons of fucking-algorithm
- Primarily focused on text-based explanations, with fewer visual aids
- May be overwhelming for absolute beginners due to its depth and complexity
Code Comparison
fucking-algorithm:
public ListNode reverseKGroup(ListNode head, int k) {
if (head == null) return null;
ListNode a, b;
a = b = head;
for (int i = 0; i < k; i++) {
if (b == null) return head;
b = b.next;
}
ListNode newHead = reverse(a, b);
a.next = reverseKGroup(b, k);
return newHead;
}
hello-algorithm:
def reverse(head, tail):
prev = tail.next
p = head
while prev != tail:
nex = p.next
p.next = prev
prev = p
p = nex
return tail, head
Both repositories offer valuable resources for learning algorithms, but fucking-algorithm provides more in-depth explanations and a wider range of topics. hello-algorithm, on the other hand, may be more suitable for beginners due to its simpler approach and visual aids. The code examples demonstrate different implementation styles and languages, with fucking-algorithm using Java and hello-algorithm using Python.
📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
Pros of javascript-algorithms
- Focuses specifically on JavaScript implementations, making it more accessible for web developers
- Includes a wider variety of algorithms and data structures, offering a more comprehensive resource
- Provides detailed explanations and complexity analysis for each algorithm
Cons of javascript-algorithms
- Less beginner-friendly, with more complex implementations and explanations
- Lacks visual aids or diagrams to help explain concepts
- Does not cover as many programming languages as hello-algorithm
Code Comparison
hello-algorithm (Python):
def binary_search(arr, target):
left, right = 0, len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1
javascript-algorithms (JavaScript):
function binarySearch(sortedArray, seekElement) {
let startIndex = 0;
let endIndex = sortedArray.length - 1;
while (startIndex <= endIndex) {
const middleIndex = startIndex + Math.floor((endIndex - startIndex) / 2);
if (sortedArray[middleIndex] === seekElement) {
return middleIndex;
}
if (sortedArray[middleIndex] < seekElement) {
startIndex = middleIndex + 1;
} else {
endIndex = middleIndex - 1;
}
}
return -1;
}
Both repositories provide implementations of common algorithms, but javascript-algorithms offers a more in-depth focus on JavaScript, while hello-algorithm covers multiple languages with a more beginner-friendly approach.
All Algorithms implemented in Python
Pros of Python
- More comprehensive collection of algorithms across various categories
- Better organized structure with clear categorization of algorithms
- Active community with frequent updates and contributions
Cons of Python
- Lacks detailed explanations or tutorials for each algorithm
- May be overwhelming for beginners due to its extensive collection
Code Comparison
hello-algorithm (JavaScript):
function bubbleSort(arr) {
for (let i = 0; i < arr.length - 1; i++) {
for (let j = 0; j < arr.length - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
[arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
}
}
}
return arr;
}
Python (Python):
def bubble_sort(array):
n = len(array)
for i in range(n):
for j in range(n - i - 1):
if array[j] > array[j + 1]:
array[j], array[j + 1] = array[j + 1], array[j]
return array
Both implementations showcase a similar approach to the bubble sort algorithm, with minor syntax differences due to the programming languages used. The Python version uses more Pythonic conventions, such as range()
for loops and tuple unpacking for swapping elements.
LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)
Pros of leetcode
- More comprehensive coverage of LeetCode problems, with solutions in multiple programming languages
- Regular updates and active community contributions
- Detailed explanations and time/space complexity analysis for each solution
Cons of leetcode
- Less focus on fundamental algorithms and data structures compared to hello-algorithm
- May be overwhelming for beginners due to the large number of problems and solutions
- Lacks a structured learning path or curriculum
Code Comparison
hello-algorithm (Python):
def binary_search(arr, target):
left, right = 0, len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1
leetcode (JavaScript):
var search = function(nums, target) {
let left = 0, right = nums.length - 1;
while (left <= right) {
const mid = Math.floor((left + right) / 2);
if (nums[mid] === target) return mid;
if (nums[mid] < target) left = mid + 1;
else right = mid - 1;
}
return -1;
};
Both repositories provide implementations of common algorithms, but leetcode offers a wider variety of problems and languages, while hello-algorithm focuses more on core concepts and explanations.
Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)
Pros of LeetCodeAnimation
- Offers animated visualizations of algorithms, making complex concepts easier to understand
- Covers a wide range of LeetCode problems with detailed explanations
- Regularly updated with new content and improvements
Cons of LeetCodeAnimation
- Primarily focuses on LeetCode problems, which may limit its scope compared to hello-algorithm
- Animations may not be as helpful for users who prefer text-based explanations
- Some users might find the visual approach less suitable for quick reference
Code Comparison
hello-algorithm:
def binary_search(arr, target):
left, right = 0, len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1
LeetCodeAnimation:
public int binarySearch(int[] nums, int target) {
int left = 0, right = nums.length - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (nums[mid] == target) return mid;
if (nums[mid] < target) left = mid + 1;
else right = mid - 1;
}
return -1;
}
Both repositories provide implementations of common algorithms, but LeetCodeAnimation focuses on visual representations, while hello-algorithm offers more text-based explanations and a broader range of topics beyond LeetCode problems.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
ç®ä»
English version repo and Gitbook is on english branch
å°æµ©ç®æ³æ¯ä¸å¥é对å°ç½çå®æ´çç®æ³è®ç»æµç¨ï¼
ç®åå ±å æ¬ä»¥ä¸å 个æ¥éª¤ï¼
- PART_1_ç®æ³åºç¡
- PART_2_åæ£å¾è§£
- PART_3_大åé¢è¯
- PART_4_CSç¥è¯æ±æ»
è¿ä¹è®¸æ¯ä¸åçæ好çç®æ³å¦ä¹ 类项ç®ï¼
æèªå·±å·é¢é½æ¯å¨ lintcode è¿è¡ï¼ä¹ä¼å¨ä¸é¢æ´æ°é¢è§£ï¼ä¸æ¹å¯ä»¥ç´æ¥è¿å ¥~
- www.lintcode.com
- å¦å¤æ¨èä¸å¥ç®æ³è¯¾ï¼å大FBåæ大佬çï¼æä¹åä¸è¿ï¼æ§ä»·æ¯å¾é«
- æåï¼ä¸æ¹æ«ç å¯ä»¥é¢åæåå¤çå·é¢æ¨¡æ¿
æ£æ
PART_1_ç®æ³åºç¡
主è¦å æ¬ä¸¤é¨åï¼
- aï¼æ°æ®ç»æç¥è¯æ¡æ¶ï¼ä¸ºäºå¤§å®¶æ´å¥½çææ¡æ°æ®ç»æåç®æ³ï¼ææåºç¡ç¥è¯æ´çæäºä¸å¼ æ维导å¾ï¼å æ¬ä¸é¢è¿äºç¥è¯ç¹ï¼
- bï¼å¯¹å¸¸ç¨çæ°æ®ç»æç¥è¯è¿è¡æ»ç»ï¼
PART_2_åæ£å¾è§£
æ¾ç¤ºæ´å¤
- å¼å§å¦ä¹
- é 读æå
- æ°ç»
- é¾è¡¨
- å¨æè§å
- å符串
- äºåæ
- æ»å¨çªå£
- åå¼è®º
- ä½è¿ç®
- äºåæ³
- å
¶ä»é«é¢é¢è¯é¢ç®
- 01.èºæç©éµ(54)
- 02.åªæ两个é®çé®ç(650)
- 03.24ç¹æ¸¸æ(679)
- 04.é£æºåº§ä½åé æ¦ç(1227)
- 05.æ°´ååç产ç
- 06.æçè(881)
- 07.æçè(881)
- 08.ç¯æ³¡å¼å ³(319)
- 09.ä¸é¨é®é¢
- 10.çæ°å游æ(299)
- 11.LRUç¼åæºå¶(146)
- 12.æå°çk个æ°
- 13.ä¸åè·¯å¾
- 14.ä¸åè·¯å¾-éç¢ç©
- 15.è¿ç»n个æ°çå
- 16.çæ°´æå¤ç容å¨
- 17.æå çä¸ç顺å容å¨
- 18.æ´æ°æå(343)
- 19.移å¨ç³åå°è¿ç»(1033)
- 20.Nim游æ(292)
- 21.寻æ¾ä¸¤ä¸ªæ£åºæ°ç»çä¸ä½æ°(4)
- 22.第k个æ大å ç´ ï¼215ï¼
- 23.éé¢åå°ï¼858ï¼
- 25.æ´æ°è½¬ç½é©¬æ°åï¼12ï¼
- 26.è·å °å½æé®é¢
- 27.å ä¹é®é¢
- 28.ææçæ°ç¬
- 29.费米估ç®
- 30.åå饼干
- 31.çå½æ¸¸æï¼289ï¼
- 32.æç´¢äºç»´ç©éµï¼74ï¼
- 33.åéï¼78ï¼
- 34.é¢è¯ä¸çæºåé¢
- 35.æ转å¾åï¼48ï¼
PART_3_大åé¢è¯ï¼æ´æ°ä¸ï¼
æ¾ç¤ºæ´å¤
èèå°ç°å¨ç½ä¸é¢ç»å®å¨å¤ªæï¼å¾å¤é½å 以 âBATâ ä¹åï¼éå¤çãé误çé½é常é«ãæ以æå°½å¯è½çæéåºäºæ认为æ¯è¾å¥½ç 50 ç¯é¢ç»ï¼åºæ¬ä¸éå¤ï¼ï¼å¹¶å¯¹å 容åäºåç±»ã
建议大家æè¿ä¸ªé¡µé¢æ¶èèµ·æ¥ï¼é²æ¢åé¢éè¦çæ¶åæ¾ä¸å°äºãï¼æ´çäºè¿40个å°æ¶ï¼è·ªæ±star~ï¼
PART_4_CS_ç¥è¯æ±æ»(TODO)
License
æ¬é¡¹ç®é¤é¨åå¼ç¨å¼æºææ¯ææ¡£çå 容å¤ï¼å¤§é¨å为æ¬äººååã欢è¿ä»»ä½ä»¥å¦ä¹ 为ç®ççä¼ æï¼ä½æªææä»»ä½å¹³å°è¿è¡è½¬è½½ï¼
Top Related Projects
《Hello 算法》:动画图解、一键运行的数据结构与算法教程。支持 Python, Java, C++, C, C#, JS, Go, Swift, Rust, Ruby, Kotlin, TS, Dart 代码。简体版和繁体版同步更新,English version ongoing
刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.
📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
All Algorithms implemented in Python
LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记 录自己的leetcode解题之路。)
Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot