├── .github └── FUNDING.yml ├── .gitignore ├── 163_course.png ├── LICENSE ├── Makefile ├── README.md ├── docs ├── 00_课程简介之笨方法学算法 │ └── why_and_how_to_learn.md ├── 01_抽象数据类型和面向对象编程 │ ├── ADT_OOP.md │ └── bag_adt.py ├── 02_数组和列表 │ ├── array_and_list.md │ ├── array_and_list.py │ └── list.png ├── 03_链表 │ ├── double_link_list.py │ ├── linked_list.md │ ├── linked_list.py │ └── lru_cache.py ├── 04_队列 │ ├── array_queue.png │ ├── array_queue.py │ ├── deque.py │ ├── queue.md │ └── queue.py ├── 05_栈 │ ├── stack.md │ └── stack.py ├── 06_算法分析 │ ├── big_o.md │ └── function_growth.png ├── 07_哈希表 │ ├── hashtable.md │ ├── hashtable.py │ ├── insert_hash.png │ ├── insert_hash_chaining.png │ ├── quadratic_hash.png │ └── quadratic_result.png ├── 08_字典 │ ├── dict.md │ └── dict_adt.py ├── 09_集合 │ ├── set.md │ ├── set.png │ └── set_adt.py ├── 10_递归 │ ├── fact.png │ ├── hanoi.gif │ ├── hanoi_four_disks.png │ ├── hanoi_tower.png │ ├── print_rec.png │ ├── recursion.md │ └── recursion.py ├── 11_线性查找与二分查找 │ ├── search.md │ └── search.py ├── 12_基本排序算法 │ ├── basic_sort.md │ └── basic_sort.py ├── 13_高级排序算法 │ ├── advanced_sorting.md │ ├── merge_sort.md │ ├── merge_sort.py │ ├── merge_sort_merge.png │ ├── merge_sort_recursion_tree.png │ ├── merge_sort_split.png │ ├── merge_sorted_array.png │ ├── merge_sorted_array_2.png │ ├── partition.png │ ├── quick_sort.md │ ├── quick_sort.png │ ├── quicksort.py │ ├── quicksort_worst.png │ ├── test.sh │ └── tn.png ├── 14_树与二叉树 │ ├── binary_tree.png │ ├── binary_tree_level.png │ ├── btree.py │ ├── complete_binary_tree.png │ ├── family_tree.png │ ├── full_binary_tree.png │ ├── perfect_binary_tree.png │ ├── preorder.png │ ├── tree.md │ └── tree.png ├── 15_堆与堆排序 │ ├── heap.png │ ├── heap_and_heapsort.md │ ├── heap_and_heapsort.py │ ├── heap_array.png │ ├── lfu.py │ ├── min_heap.py │ ├── siftdown.png │ ├── siftup.png │ └── topk.py ├── 163_course.png ├── 16_优先级队列 │ ├── priority_queue.md │ └── priority_queue.py ├── 17_二叉查找树 │ ├── binary_search_tree.md │ ├── bst.png │ ├── bst.py │ ├── bst_insert.png │ ├── bst_remove_leaf.png │ ├── bst_remove_node_with_one_child.png │ ├── bst_search.png │ ├── bst_worstcase.png │ ├── find_successor.png │ ├── predecessor_successor.png │ └── remove_interior_replace.png ├── 18_图与图的遍历 │ ├── bfs.png │ ├── graph.md │ ├── graph.py │ ├── graph_rep.png │ └── graph_road.png ├── 19_python内置常用算法和数据结构 │ └── builtins.md ├── 20_面试指南 │ └── interview.md └── index.md ├── mkdocs.yml ├── requirements.txt └── 剑指offer ├── 03_FindInPartiallySortedMatrix(二维数组中的查找).py ├── 04_ReplaceBlank(替换空格).py ├── 05_PrintListInReversedOrder(从尾到头打印链表).py ├── 06_ConstructBinaryTree(重建二叉树).py ├── 07_QueueWithTwoStacks(用两个栈实现队列).py ├── 08_MinNumberInRotatedArray(旋转数组最小数字).py ├── 10_NumberOf1InBinary(二进制中1的个数).py ├── 12_Print1ToMaxOfNDigits(打印1到最大的n位数).py ├── 13_DeleteNodeInList(O1时间删除链表节点).py ├── 14_ReorderArray(调整奇偶顺序).py ├── 15_KthNodeFromEnd(链表倒数第k个节点).py ├── 16_ReverseList(翻转链表).py ├── 17_MergeSortedLists(合并两个有序链表).py ├── 18_SubstructureInTree(树的子结构).py ├── 19_MirrorOfBinaryTree(二叉树镜像).py ├── 20_PrintMatrix(螺旋矩阵).py ├── 21_MinInStack(包含min 函数的栈).py ├── 22_StackPushPopOrder(栈的压入弹出序列).py ├── 23_BfsTree(层序从上往下打印二叉树).py ├── 24_SquenceOfBST(二叉搜索树的后序遍历序列).py ├── 25_PathInTree(二叉树和为某一个值).py ├── 27_ConvertBinarySearchTree(二叉搜索树转成双向链表).py ├── 28_StringPermutation(字符串全排列).py ├── 29_MoreThanHalfNumber(数组中出现次数超过一半的数字).py ├── 30_KLeastNumbers(最小的 k 个数).py ├── 31_GreatestSumOfSubarrays(连续子数组最大和).py ├── 32_NumberOf1(从1到n整数中1出现的次数).py ├── 33_SortArrayForMinNumber(把数组排成最小的数).py ├── 34_UglyNumber(丑数).py ├── 35_FirstNotRepeatingChar(第一个只出现一次的字符).py ├── 36_InversePairs(数组中的逆序对).py ├── 37_FirstCommonNodesInLists(两个链表的第一个公共结点).py ├── 38_NumberOfK(数字在排序数组中出现的次数).py ├── 39_1_TreeDepth(二叉树深度).py ├── 40_NumbersAppearOnce(数组中只出现一次的数字).py ├── 41_1_TwoNumbersWithSum(和为s的两个数字VS和为s的连续正数序列).py └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/.github/FUNDING.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/.gitignore -------------------------------------------------------------------------------- /163_course.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/163_course.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/LICENSE -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/Makefile -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/README.md -------------------------------------------------------------------------------- /docs/00_课程简介之笨方法学算法/why_and_how_to_learn.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/00_课程简介之笨方法学算法/why_and_how_to_learn.md -------------------------------------------------------------------------------- /docs/01_抽象数据类型和面向对象编程/ADT_OOP.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/01_抽象数据类型和面向对象编程/ADT_OOP.md -------------------------------------------------------------------------------- /docs/01_抽象数据类型和面向对象编程/bag_adt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/01_抽象数据类型和面向对象编程/bag_adt.py -------------------------------------------------------------------------------- /docs/02_数组和列表/array_and_list.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/02_数组和列表/array_and_list.md -------------------------------------------------------------------------------- /docs/02_数组和列表/array_and_list.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/02_数组和列表/array_and_list.py -------------------------------------------------------------------------------- /docs/02_数组和列表/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/02_数组和列表/list.png -------------------------------------------------------------------------------- /docs/03_链表/double_link_list.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/03_链表/double_link_list.py -------------------------------------------------------------------------------- /docs/03_链表/linked_list.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/03_链表/linked_list.md -------------------------------------------------------------------------------- /docs/03_链表/linked_list.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/03_链表/linked_list.py -------------------------------------------------------------------------------- /docs/03_链表/lru_cache.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/03_链表/lru_cache.py -------------------------------------------------------------------------------- /docs/04_队列/array_queue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/04_队列/array_queue.png -------------------------------------------------------------------------------- /docs/04_队列/array_queue.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/04_队列/array_queue.py -------------------------------------------------------------------------------- /docs/04_队列/deque.py: -------------------------------------------------------------------------------- 1 | # 留给读者练习,如果实在想不出,在第 5 章栈里 stack.py 会有实现 2 | -------------------------------------------------------------------------------- /docs/04_队列/queue.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/04_队列/queue.md -------------------------------------------------------------------------------- /docs/04_队列/queue.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/04_队列/queue.py -------------------------------------------------------------------------------- /docs/05_栈/stack.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/05_栈/stack.md -------------------------------------------------------------------------------- /docs/05_栈/stack.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/05_栈/stack.py -------------------------------------------------------------------------------- /docs/06_算法分析/big_o.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/06_算法分析/big_o.md -------------------------------------------------------------------------------- /docs/06_算法分析/function_growth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/06_算法分析/function_growth.png -------------------------------------------------------------------------------- /docs/07_哈希表/hashtable.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/07_哈希表/hashtable.md -------------------------------------------------------------------------------- /docs/07_哈希表/hashtable.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/07_哈希表/hashtable.py -------------------------------------------------------------------------------- /docs/07_哈希表/insert_hash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/07_哈希表/insert_hash.png -------------------------------------------------------------------------------- /docs/07_哈希表/insert_hash_chaining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/07_哈希表/insert_hash_chaining.png -------------------------------------------------------------------------------- /docs/07_哈希表/quadratic_hash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/07_哈希表/quadratic_hash.png -------------------------------------------------------------------------------- /docs/07_哈希表/quadratic_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/07_哈希表/quadratic_result.png -------------------------------------------------------------------------------- /docs/08_字典/dict.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/08_字典/dict.md -------------------------------------------------------------------------------- /docs/08_字典/dict_adt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/08_字典/dict_adt.py -------------------------------------------------------------------------------- /docs/09_集合/set.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/09_集合/set.md -------------------------------------------------------------------------------- /docs/09_集合/set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/09_集合/set.png -------------------------------------------------------------------------------- /docs/09_集合/set_adt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/09_集合/set_adt.py -------------------------------------------------------------------------------- /docs/10_递归/fact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/10_递归/fact.png -------------------------------------------------------------------------------- /docs/10_递归/hanoi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/10_递归/hanoi.gif -------------------------------------------------------------------------------- /docs/10_递归/hanoi_four_disks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/10_递归/hanoi_four_disks.png -------------------------------------------------------------------------------- /docs/10_递归/hanoi_tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/10_递归/hanoi_tower.png -------------------------------------------------------------------------------- /docs/10_递归/print_rec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/10_递归/print_rec.png -------------------------------------------------------------------------------- /docs/10_递归/recursion.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/10_递归/recursion.md -------------------------------------------------------------------------------- /docs/10_递归/recursion.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/10_递归/recursion.py -------------------------------------------------------------------------------- /docs/11_线性查找与二分查找/search.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/11_线性查找与二分查找/search.md -------------------------------------------------------------------------------- /docs/11_线性查找与二分查找/search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/11_线性查找与二分查找/search.py -------------------------------------------------------------------------------- /docs/12_基本排序算法/basic_sort.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/12_基本排序算法/basic_sort.md -------------------------------------------------------------------------------- /docs/12_基本排序算法/basic_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/12_基本排序算法/basic_sort.py -------------------------------------------------------------------------------- /docs/13_高级排序算法/advanced_sorting.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/advanced_sorting.md -------------------------------------------------------------------------------- /docs/13_高级排序算法/merge_sort.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/merge_sort.md -------------------------------------------------------------------------------- /docs/13_高级排序算法/merge_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/merge_sort.py -------------------------------------------------------------------------------- /docs/13_高级排序算法/merge_sort_merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/merge_sort_merge.png -------------------------------------------------------------------------------- /docs/13_高级排序算法/merge_sort_recursion_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/merge_sort_recursion_tree.png -------------------------------------------------------------------------------- /docs/13_高级排序算法/merge_sort_split.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/merge_sort_split.png -------------------------------------------------------------------------------- /docs/13_高级排序算法/merge_sorted_array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/merge_sorted_array.png -------------------------------------------------------------------------------- /docs/13_高级排序算法/merge_sorted_array_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/merge_sorted_array_2.png -------------------------------------------------------------------------------- /docs/13_高级排序算法/partition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/partition.png -------------------------------------------------------------------------------- /docs/13_高级排序算法/quick_sort.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/quick_sort.md -------------------------------------------------------------------------------- /docs/13_高级排序算法/quick_sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/quick_sort.png -------------------------------------------------------------------------------- /docs/13_高级排序算法/quicksort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/quicksort.py -------------------------------------------------------------------------------- /docs/13_高级排序算法/quicksort_worst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/quicksort_worst.png -------------------------------------------------------------------------------- /docs/13_高级排序算法/test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/test.sh -------------------------------------------------------------------------------- /docs/13_高级排序算法/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/13_高级排序算法/tn.png -------------------------------------------------------------------------------- /docs/14_树与二叉树/binary_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/binary_tree.png -------------------------------------------------------------------------------- /docs/14_树与二叉树/binary_tree_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/binary_tree_level.png -------------------------------------------------------------------------------- /docs/14_树与二叉树/btree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/btree.py -------------------------------------------------------------------------------- /docs/14_树与二叉树/complete_binary_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/complete_binary_tree.png -------------------------------------------------------------------------------- /docs/14_树与二叉树/family_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/family_tree.png -------------------------------------------------------------------------------- /docs/14_树与二叉树/full_binary_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/full_binary_tree.png -------------------------------------------------------------------------------- /docs/14_树与二叉树/perfect_binary_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/perfect_binary_tree.png -------------------------------------------------------------------------------- /docs/14_树与二叉树/preorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/preorder.png -------------------------------------------------------------------------------- /docs/14_树与二叉树/tree.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/tree.md -------------------------------------------------------------------------------- /docs/14_树与二叉树/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/14_树与二叉树/tree.png -------------------------------------------------------------------------------- /docs/15_堆与堆排序/heap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/heap.png -------------------------------------------------------------------------------- /docs/15_堆与堆排序/heap_and_heapsort.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/heap_and_heapsort.md -------------------------------------------------------------------------------- /docs/15_堆与堆排序/heap_and_heapsort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/heap_and_heapsort.py -------------------------------------------------------------------------------- /docs/15_堆与堆排序/heap_array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/heap_array.png -------------------------------------------------------------------------------- /docs/15_堆与堆排序/lfu.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/lfu.py -------------------------------------------------------------------------------- /docs/15_堆与堆排序/min_heap.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/min_heap.py -------------------------------------------------------------------------------- /docs/15_堆与堆排序/siftdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/siftdown.png -------------------------------------------------------------------------------- /docs/15_堆与堆排序/siftup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/siftup.png -------------------------------------------------------------------------------- /docs/15_堆与堆排序/topk.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/15_堆与堆排序/topk.py -------------------------------------------------------------------------------- /docs/163_course.png: -------------------------------------------------------------------------------- 1 | ../163_course.png -------------------------------------------------------------------------------- /docs/16_优先级队列/priority_queue.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/16_优先级队列/priority_queue.md -------------------------------------------------------------------------------- /docs/16_优先级队列/priority_queue.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/16_优先级队列/priority_queue.py -------------------------------------------------------------------------------- /docs/17_二叉查找树/binary_search_tree.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/binary_search_tree.md -------------------------------------------------------------------------------- /docs/17_二叉查找树/bst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/bst.png -------------------------------------------------------------------------------- /docs/17_二叉查找树/bst.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/bst.py -------------------------------------------------------------------------------- /docs/17_二叉查找树/bst_insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/bst_insert.png -------------------------------------------------------------------------------- /docs/17_二叉查找树/bst_remove_leaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/bst_remove_leaf.png -------------------------------------------------------------------------------- /docs/17_二叉查找树/bst_remove_node_with_one_child.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/bst_remove_node_with_one_child.png -------------------------------------------------------------------------------- /docs/17_二叉查找树/bst_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/bst_search.png -------------------------------------------------------------------------------- /docs/17_二叉查找树/bst_worstcase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/bst_worstcase.png -------------------------------------------------------------------------------- /docs/17_二叉查找树/find_successor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/find_successor.png -------------------------------------------------------------------------------- /docs/17_二叉查找树/predecessor_successor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/predecessor_successor.png -------------------------------------------------------------------------------- /docs/17_二叉查找树/remove_interior_replace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/17_二叉查找树/remove_interior_replace.png -------------------------------------------------------------------------------- /docs/18_图与图的遍历/bfs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/18_图与图的遍历/bfs.png -------------------------------------------------------------------------------- /docs/18_图与图的遍历/graph.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/18_图与图的遍历/graph.md -------------------------------------------------------------------------------- /docs/18_图与图的遍历/graph.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/18_图与图的遍历/graph.py -------------------------------------------------------------------------------- /docs/18_图与图的遍历/graph_rep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/18_图与图的遍历/graph_rep.png -------------------------------------------------------------------------------- /docs/18_图与图的遍历/graph_road.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/18_图与图的遍历/graph_road.png -------------------------------------------------------------------------------- /docs/19_python内置常用算法和数据结构/builtins.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/19_python内置常用算法和数据结构/builtins.md -------------------------------------------------------------------------------- /docs/20_面试指南/interview.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/docs/20_面试指南/interview.md -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ../README.md -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/mkdocs.yml -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/requirements.txt -------------------------------------------------------------------------------- /剑指offer/03_FindInPartiallySortedMatrix(二维数组中的查找).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/03_FindInPartiallySortedMatrix(二维数组中的查找).py -------------------------------------------------------------------------------- /剑指offer/04_ReplaceBlank(替换空格).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/04_ReplaceBlank(替换空格).py -------------------------------------------------------------------------------- /剑指offer/05_PrintListInReversedOrder(从尾到头打印链表).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/05_PrintListInReversedOrder(从尾到头打印链表).py -------------------------------------------------------------------------------- /剑指offer/06_ConstructBinaryTree(重建二叉树).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/06_ConstructBinaryTree(重建二叉树).py -------------------------------------------------------------------------------- /剑指offer/07_QueueWithTwoStacks(用两个栈实现队列).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/07_QueueWithTwoStacks(用两个栈实现队列).py -------------------------------------------------------------------------------- /剑指offer/08_MinNumberInRotatedArray(旋转数组最小数字).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/08_MinNumberInRotatedArray(旋转数组最小数字).py -------------------------------------------------------------------------------- /剑指offer/10_NumberOf1InBinary(二进制中1的个数).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/10_NumberOf1InBinary(二进制中1的个数).py -------------------------------------------------------------------------------- /剑指offer/12_Print1ToMaxOfNDigits(打印1到最大的n位数).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/12_Print1ToMaxOfNDigits(打印1到最大的n位数).py -------------------------------------------------------------------------------- /剑指offer/13_DeleteNodeInList(O1时间删除链表节点).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/13_DeleteNodeInList(O1时间删除链表节点).py -------------------------------------------------------------------------------- /剑指offer/14_ReorderArray(调整奇偶顺序).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/14_ReorderArray(调整奇偶顺序).py -------------------------------------------------------------------------------- /剑指offer/15_KthNodeFromEnd(链表倒数第k个节点).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/15_KthNodeFromEnd(链表倒数第k个节点).py -------------------------------------------------------------------------------- /剑指offer/16_ReverseList(翻转链表).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/16_ReverseList(翻转链表).py -------------------------------------------------------------------------------- /剑指offer/17_MergeSortedLists(合并两个有序链表).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/17_MergeSortedLists(合并两个有序链表).py -------------------------------------------------------------------------------- /剑指offer/18_SubstructureInTree(树的子结构).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/18_SubstructureInTree(树的子结构).py -------------------------------------------------------------------------------- /剑指offer/19_MirrorOfBinaryTree(二叉树镜像).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/19_MirrorOfBinaryTree(二叉树镜像).py -------------------------------------------------------------------------------- /剑指offer/20_PrintMatrix(螺旋矩阵).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/20_PrintMatrix(螺旋矩阵).py -------------------------------------------------------------------------------- /剑指offer/21_MinInStack(包含min 函数的栈).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/21_MinInStack(包含min 函数的栈).py -------------------------------------------------------------------------------- /剑指offer/22_StackPushPopOrder(栈的压入弹出序列).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/22_StackPushPopOrder(栈的压入弹出序列).py -------------------------------------------------------------------------------- /剑指offer/23_BfsTree(层序从上往下打印二叉树).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/23_BfsTree(层序从上往下打印二叉树).py -------------------------------------------------------------------------------- /剑指offer/24_SquenceOfBST(二叉搜索树的后序遍历序列).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/24_SquenceOfBST(二叉搜索树的后序遍历序列).py -------------------------------------------------------------------------------- /剑指offer/25_PathInTree(二叉树和为某一个值).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/25_PathInTree(二叉树和为某一个值).py -------------------------------------------------------------------------------- /剑指offer/27_ConvertBinarySearchTree(二叉搜索树转成双向链表).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/27_ConvertBinarySearchTree(二叉搜索树转成双向链表).py -------------------------------------------------------------------------------- /剑指offer/28_StringPermutation(字符串全排列).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/28_StringPermutation(字符串全排列).py -------------------------------------------------------------------------------- /剑指offer/29_MoreThanHalfNumber(数组中出现次数超过一半的数字).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/29_MoreThanHalfNumber(数组中出现次数超过一半的数字).py -------------------------------------------------------------------------------- /剑指offer/30_KLeastNumbers(最小的 k 个数).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/30_KLeastNumbers(最小的 k 个数).py -------------------------------------------------------------------------------- /剑指offer/31_GreatestSumOfSubarrays(连续子数组最大和).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/31_GreatestSumOfSubarrays(连续子数组最大和).py -------------------------------------------------------------------------------- /剑指offer/32_NumberOf1(从1到n整数中1出现的次数).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/32_NumberOf1(从1到n整数中1出现的次数).py -------------------------------------------------------------------------------- /剑指offer/33_SortArrayForMinNumber(把数组排成最小的数).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/33_SortArrayForMinNumber(把数组排成最小的数).py -------------------------------------------------------------------------------- /剑指offer/34_UglyNumber(丑数).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/34_UglyNumber(丑数).py -------------------------------------------------------------------------------- /剑指offer/35_FirstNotRepeatingChar(第一个只出现一次的字符).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/35_FirstNotRepeatingChar(第一个只出现一次的字符).py -------------------------------------------------------------------------------- /剑指offer/36_InversePairs(数组中的逆序对).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/36_InversePairs(数组中的逆序对).py -------------------------------------------------------------------------------- /剑指offer/37_FirstCommonNodesInLists(两个链表的第一个公共结点).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/37_FirstCommonNodesInLists(两个链表的第一个公共结点).py -------------------------------------------------------------------------------- /剑指offer/38_NumberOfK(数字在排序数组中出现的次数).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/38_NumberOfK(数字在排序数组中出现的次数).py -------------------------------------------------------------------------------- /剑指offer/39_1_TreeDepth(二叉树深度).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/39_1_TreeDepth(二叉树深度).py -------------------------------------------------------------------------------- /剑指offer/40_NumbersAppearOnce(数组中只出现一次的数字).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/40_NumbersAppearOnce(数组中只出现一次的数字).py -------------------------------------------------------------------------------- /剑指offer/41_1_TwoNumbersWithSum(和为s的两个数字VS和为s的连续正数序列).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/41_1_TwoNumbersWithSum(和为s的两个数字VS和为s的连续正数序列).py -------------------------------------------------------------------------------- /剑指offer/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/python_data_structures_and_algorithms/HEAD/剑指offer/README.md --------------------------------------------------------------------------------