Skip to content

rentainhe/interview-algorithm-collection

Repository files navigation

interview-algorithm-collection

A collection of interview algorithm problems and solutions

Good notes online

Good learning website

Basic knowledge

code algorithm method
binary search 查找算法 二分查找
sort algorithm 经典排序算法 快速排序, 冒泡排序, 插入排序, 选择排序

Content

question leetcode-number answer method
计算IOU ... IoU.py ...
求两个数的最小公倍数和最大公约数 ... 最小公约和最大公倍 ...
最小路径和 leetcode-64 minimum_path_sum.py 动态规划
盛水最多的容器 leetcode-11 most_water.py 双指针-左右指针
删除链表的倒数第N个结点 leetcode-19 remove_node.py 双指针-快慢指针-使用dummy head小技巧
最长回文子串 leetcode-5 longest_palindromic_substring.py 动态规划或者中心扩散
最接近的三数之和 leetcode-16 3sum_closest.py
leetcode-优质题解
数组排序-双指针
路径总和II leetcode-113 path_sum_ii.py BFS算法, DFS算法, 注意题目要求
从上到下打印二叉树 剑指 Offer 32 print_tree.py BFS算法
全排列 leetcode-46 Permutations.py 回溯法
全排列II leetcode-47 Permutations_II.py 回溯法
组合总和 leetcode-39 Combination_Sum.py 回溯法
组合总和II leetcode-40 Combination_Sum_II 回溯法
矩阵中的路径 剑指 Offer 12 Exist_path_in_matrix.py DFS回溯, 注意剪枝条件
从前序与中序遍历序列构造二叉树 leetcode-105
剑指 Offer 07
build_Tree_From_Preorder_And_Inorder.py 迭代递归
从中序和后序遍历序列构造二叉树 leetcode-106 build_Tree_From_Inorder_And_Postorder.py 迭代递归
从前序和后序遍历序列构造二叉树 leetcode-889 build_Tree_From_Preorder_And_Postorder.py 迭代递归
二叉搜索树的后序遍历序列 剑指 Offer 33 offer-33.py 递归
二叉树的深度 剑指 Offer 55 Depth_of_Binary_Tree.py 用栈实现, 方法类似于层序遍历
连续子数组的最大和 剑指 Offer 42 Maximum_Subarray.py 动态规划
礼物的最大价值 剑指 Offer 47 offer-47.py 动态规划
最长不含重复字符的子字符串 剑指 Offer 48 offer-48.py 快慢指针
字符串的排列 剑指 Offer 38 offer-38.py 回溯 + 剪枝
数组中出现次数超过一半的数字 剑指 Offer 39 offer-39.py 哈希表
前k个高频元素 leetcode-347 Top_K_Frequent_elements.py 构建hashmap, 字典排序
合并区间 leetcode-56 Merge_Intervals.py 对数组进行排序, 然后按顺序添加
不同路径 leetcode-62 Unique_Paths 动态规划
不同路径 II leetcode-63 Unique_Paths_II 动态规划, 注意和上题初始化的不同
最长回文子串 leetcode-5 longest_palindromic_substring.py 动态规划
最长递增子序列 leetcode-300 Longest_Increasing_Subsequence.py 动态规划
迷宫问题_II(图森) leetcode-45 跳跃游戏_II 动态规划
迷宫问题_III(图森) leetcode-1306 跳跃游戏_III DFS

About

A collection of interview algorithm problems and solutions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages