题库chevron_right分类chevron_right排序
sort

排序

400 道题目
简单: 81中等: 233困难: 86

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

题库

排序 题库

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

慢加载专题题库

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

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 400 道题目

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

三数之和

Given an integer array, return all unique triplets where the sum is zero using two-pointer scanning with careful duplica…

中等
16

最接近的三数之和

Find the sum of three integers in an array that is closest to a given target using two-pointer scanning.

中等
18

四数之和

The 4Sum problem requires finding all unique quadruplets in an array that sum to a specific target value.

中等
47

全排列 II

Generate all unique permutations of an array containing duplicates using backtracking and pruning to avoid repeated sequ…

中等
49

字母异位词分组

Group the anagrams in a list of strings using efficient hash table-based methods, focusing on array scanning.

中等
56

合并区间

Merge Intervals requires sorting an array of interval pairs and combining overlaps efficiently using sequential comparis…

中等
75

颜色分类

Sort Colors requires in-place reordering of an array using a two-pointer scanning strategy to group 0s, 1s, and 2s effic…

中等
88

合并两个有序数组

Merge two sorted arrays into the first array in non-decreasing order, using a two-pointer approach.

简单
147

对链表进行插入排序

Sort a singly linked list using insertion sort by carefully manipulating pointers to maintain a sorted order efficiently…

中等
148

排序链表

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

中等
164

最大间距

Find the largest difference between successive elements in a sorted array efficiently using linear time techniques and b…

中等
169

多数元素

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

简单
179

最大数

The problem asks to arrange integers to form the largest possible number, focusing on greedy algorithms and string handl…

中等
215

数组中的第K个最大元素

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

中等
217

存在重复元素

Determine if an integer array contains any duplicate values by efficiently scanning with a hash lookup to ensure fast de…

简单
220

存在重复元素 III

The problem involves finding a pair of indices in an array where the index and value differences are within given limits…

困难
229

多数元素 II

Identify all elements in an integer array appearing more than ⌊ n/3 ⌋ times using efficient array scanning and hash coun…

中等
242

有效的字母异位词

Check if two strings are anagrams using hashing or sorting techniques.

简单
268

丢失的数字

Find the missing number in an array containing distinct numbers in the range [0, n].

简单
274

H 指数

Determine a researcher's h-index by analyzing citations using array sorting and counting techniques efficiently and accu…

中等
295

数据流的中位数

Implement a MedianFinder class that supports adding numbers and finding the median from a data stream.

困难
324

摆动排序 II

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

中等
347

前 K 个高频元素

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

中等
349

两个数组的交集

Find the intersection of two arrays while ensuring unique elements using efficient array scanning and hash lookups.

简单

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

关联高频模式

LeetCode 排序题型题解:400题训练路线