摘要:
Java:集合List转化为数组Array的方法 一、使用toArray()方法 LinkedList<Integer> list = new LinkedList<>(); list.add(1); list.add(2); list.add(3); //方法一:构造与list相同容量的数组 li 阅读全文
摘要:
如图所示,假设左边小于右边 通过如下分析,双指针每次只需要移动较小那边即可,因为只有移动较小那边才有比初始的容量大的可能 代码如下: class Solution { public: int maxArea(vector<int>& height) { int i = 0, j = height.s 阅读全文
摘要:
Prim算法 算法原理 代码实现 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 510, INF = 0x3f3f3f3f; int n, m; int g 阅读全文