题库chevron_right分类chevron_right分治
call_split

分治

42 道题目
简单: 5中等: 24困难: 13

分治 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

题库

分治 题库

先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。

慢加载专题题库

适合这类题很多的专题,先扫结构,再逐步深入。

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 42 道题目

每次续载 24 题
#题目难度
4

寻找两个正序数组的中位数

Find the median of two sorted arrays using binary search for efficient O(log(min(m, n))) time complexity.

困难
23

合并 K 个升序链表

Merge k Sorted Lists requires efficiently combining multiple sorted linked lists into one using pointers and priority qu…

困难
53

最大子数组和

Maximum Subarray is a classic state transition dynamic programming problem about deciding whether to extend or restart a…

中等
105

从前序与中序遍历序列构造二叉树

Construct a binary tree using preorder and inorder traversal arrays, leveraging array scanning and hash table lookups.

中等
106

从中序与后序遍历序列构造二叉树

Reconstruct a binary tree from given inorder and postorder arrays using array scanning and hash lookup to optimize recur…

中等
108

将有序数组转换为二叉搜索树

Pick the middle element as root at each step so the sorted array becomes a height-balanced BST with valid ordering.

简单
109

有序链表转换二叉搜索树

Convert a sorted singly linked list into a height-balanced BST using pointer manipulation and divide-and-conquer recursi…

中等
148

排序链表

Sort List requires sorting a singly linked list efficiently using pointer manipulation and merge sort for optimal perfor…

中等
169

多数元素

Find the majority element in an array, where the element appears more than n/2 times, using efficient algorithms.

简单
190

颠倒二进制位

Reverse a 32-bit unsigned integer by manipulating bits efficiently using a divide and conquer approach with careful bit …

简单
191

位1的个数

Number of 1 Bits is a classic bit manipulation problem where clearing the lowest set bit gives the cleanest count.

简单
215

数组中的第K个最大元素

Find the kth largest element in an unsorted array using optimal approaches like Quickselect or heaps.

中等
218

天际线问题

The Skyline Problem requires calculating a city's silhouette using array manipulation and divide-and-conquer techniques …

困难
240

搜索二维矩阵 II

Efficiently search for a target in a 2D matrix using binary search and matrix properties.

中等
315

计算右侧小于当前元素的个数

Solve the Count of Smaller Numbers After Self problem using binary search and optimized algorithms.

困难
324

摆动排序 II

Rearrange an array in a way that every odd-indexed element is greater than its adjacent even-indexed elements.

中等
327

区间和的个数

Count the number of subarray sums within a given inclusive range using optimized divide-and-conquer techniques efficient…

困难
347

前 K 个高频元素

Find the k most frequent elements from an array using efficient algorithms like hashing and sorting.

中等
372

超级次方

Compute large exponentiations efficiently using modular arithmetic and divide-and-conquer techniques for this Super Pow …

中等
395

至少有 K 个重复字符的最长子串

Find the length of the longest substring where every character appears at least k times using sliding window and divide-…

中等
427

建立四叉树

Construct a Quad-Tree from a binary matrix by recursively subdividing regions and tracking uniform states efficiently.

中等
493

翻转对

Count the number of reverse pairs in a given integer array using efficient algorithms like binary search and merge sort.

困难
558

四叉树交集

Compute the logical OR of two binary matrices represented as Quad-Trees using recursive tree traversal and state propaga…

中等
654

最大二叉树

Construct a maximum binary tree by recursively selecting the largest element and dividing the array into left and right …

中等

swap_vert在题库框内继续向下滚动,也会自动续载

关联高频模式

LeetCode 分治题型题解:42题训练路线