二分法
文章平均质量分 73
决定要好好毒树的Lucifer
这个作者很懒,什么都没留下…
展开
-
LeetCode1631 - 最小体力消耗 (二分法BFS遍历、并查集)
题目:You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the height of cell (row, col). You are situated(位于) in the top-left cell, (0, 0), and you hope to travel to th原创 2022-02-21 23:56:38 · 256 阅读 · 0 评论 -
LeetCode778 - 水位上升的泳池 (二分法BFS遍历、并查集)
题目:You are given an n x n integer matrix grid where each value grid[i][j] represents the elevation at that point (i, j).The rain starts to fall. At time t, the depth of the water everywhere is t. You can swim from a square to another 4-directionally ad原创 2022-02-15 18:14:26 · 251 阅读 · 0 评论 -
LeetCode 74 - 搜索二维矩阵 (二分法)
题目:Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each row is greater than the last inte原创 2022-02-14 14:25:36 · 631 阅读 · 0 评论 -
LeetCode 162 - 寻找峰值 (二分法)
题目:A peak element is an element that is strictly greater than its neighbors.Given an integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.You may imagine that nums[-原创 2022-02-13 23:48:18 · 206 阅读 · 0 评论