MCPcopy Index your code
hub / github.com/krahets/LeetCode-Book

github.com/krahets/LeetCode-Book @main

repository ↗ · DeepWiki ↗ · + Follow
1,706 symbols 3,397 edges 519 files 45 documented · 3%
README

《图解算法数据结构》是一本面向算法初学者和互联网求职者编写的 LeetBook 手册。

  • 图文详解 75 道题目,覆盖主要算法知识点。
  • 题目活跃于各大互联网公司招聘中,可使笔面试准备事半功倍。
  • 致力于行文深入浅出、图文搭配,提供简洁的 Python, Java, C++ 解题代码。

[!NOTE]

本仓库包含:

python LeetCode-Book ├── sword_for_offer # 《剑指 Offer》题目解析、配套代码、刷题计划 ├── selected_coding_interview # 《Krahets 笔面试精选 88 题》题目解析、配套代码 └── leetbook_ioa # 《图解算法数据结构》题目解析

若本仓库对您有所帮助,请在页面右上角点个 Star :star: 支持一下,谢谢!

如何学习算法

第一步:看入门书

《Hello 算法》 —— 动画图解、一键运行的数据结构与算法教程

此书旨在引导初学者探索数据结构与算法的知识地图,掌握刷题需要的前置知识与工具库。

[!TIP] 建议先读完这本书(概括且全面地了解数据结构与算法),再开始刷题(深入探索各类算法和数据结构)。

第二步:刷算法题

推荐以下 LeetCode 题单:

  1. Krahets 笔面试精选 88 题:从“剑指 Offer”和“热题 100”精选出的 88 道高频算法笔试题,适合初学者入门。
  2. LeetCode 热题 100:力扣用户最喜爱的 100 道题。
  3. 面试经典 150 题:150 道经典面试力扣题。
  4. LeetCode-75:精选 75 道面试核心题目。

对初学者刷题的一些建议:

  1. 建议每日刷 2~3 题。若能轻松完成,可以尝试增加至 5~8 题。
  2. 刷题的质量比数量更加重要。请确保你真正理解了每个题目的解法及背后的算法原理。
  3. 建议你按照题单目录的顺序做题。如果感觉一道题很难,可以先跳过,后续再攻克。
  4. 题目通常有不止一种解法,请你注意比较和探讨各种方法的特点和适用情况。
  5. 如果你发现自己遗忘了题目解法,不必灰心;我们通常需要复习三次以上,才能真正掌握一个知识点。
  6. 行百里者半九十。坚持至关重要,加油!

License

The texts, code, and images in this repository are licensed under CC BY-NC-SA-4.0.

Core symbols most depended-on inside this repo

add
called by 85
sword_for_offer/codes/java/sfo_65_implement_addition_operation_without_arithmetic_operators_s1/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.java
add
called by 71
sword_for_offer/codes/python/sfo_65_implement_addition_operation_without_arithmetic_operators_s1.py
list_to_tree
called by 22
sword_for_offer/codes/python/include/binary_tree.py
list_to_tree
called by 21
selected_coding_interview/codes/python/include/binary_tree.py
arrToTree
called by 21
sword_for_offer/codes/java/include/TreeNode.java
arrToTree
called by 20
selected_coding_interview/codes/java/include/TreeNode.java
pop
called by 16
selected_coding_interview/codes/python/lc_155_min_stack.py
pop
called by 14
sword_for_offer/codes/python/sfo_30_min_stack_s1.py

Shape

Method 922
Class 763
Function 21

Languages

Java63%
Python37%

Modules by API surface

sword_for_offer/codes/java/sfo_30_min_stack_s1/sfo_30_min_stack_s1.java8 symbols
selected_coding_interview/codes/java/lc_232_implement_queue_using_stacks/lc_232_implement_queue_using_stacks.java8 symbols
selected_coding_interview/codes/java/lc_155_min_stack/lc_155_min_stack.java8 symbols
sword_for_offer/codes/java/sfo_59ii_max_queue_s1/sfo_59ii_max_queue_s1.java7 symbols
sword_for_offer/codes/java/sfo_36_binary_search_tree_and_doubly_linked_list_s1/sfo_36_binary_search_tree_and_doubly_linked_list_s1.java7 symbols
sword_for_offer/codes/python/sfo_30_min_stack_s1.py6 symbols
sword_for_offer/codes/python/include/print_util.py6 symbols
sword_for_offer/codes/java/sfo_41_find_median_from_data_stream_s1/sfo_41_find_median_from_data_stream_s1.java6 symbols
sword_for_offer/codes/java/sfo_40_the_smallest_k_numbers_s2/sfo_40_the_smallest_k_numbers_s2.java6 symbols
sword_for_offer/codes/java/sfo_40_the_smallest_k_numbers_s1/sfo_40_the_smallest_k_numbers_s1.java6 symbols
sword_for_offer/codes/java/sfo_38_all_permutations_of_a_string_s1/sfo_38_all_permutations_of_a_string_s1.java6 symbols
sword_for_offer/codes/java/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2/sfo_35_clone_a_linked_list_with_next_and_random_pointer_s2.java6 symbols

For agents

$ claude mcp add LeetCode-Book \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact