最新文章

1个快速排序等于5+个LeetCode题目

少于 1 分钟读完

快速排序最坏情况运行时间为O(n^2),虽然这个最坏情况运行时间比较差,但快速排序通常是用于排序的最佳的实用选择,这是因为其平均性能相当好:期望运行时间为O(nlgn),而且O(nlgn)记号中隐含的常数因子很小。 ——《算法导论》

Number of Islands

少于 1 分钟读完

Given a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands...

3Sum

少于 1 分钟读完

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.

Word Search II

少于 1 分钟读完

Given a 2D board and a list of words from the dictionary, find all words in the board.