摘要:
01背包问题 二维表示 #include <bits/stdc++.h> using namespace std; const int MAXN = 1010; int v[MAXN], val[MAXN], dp[MAXN][MAXN]; int main(){ int n, m; cin >> 阅读全文
摘要:
0、二叉树结点的构造 1 public static class Node { 2 public int value; 3 public Node left; 4 public Node right; 5 6 public Node(int data) { 7 this.value = data; 阅读全文
摘要:
1、用两个栈实现队列 add:压入栈后pushToPop poll:pushToPop后弹出栈 peek:pushToPop后得到队首元素 1 public class TwoStacksQueue { 2 public Stack<Integer> stackPush; 3 public Stac 阅读全文