摘要:
public class Solution { public int Fibonacci(int n) { //错误输入处理 if(n<0) return -1; int pre = 1; int result = 0; for(int i=0; i<n; i++){ //计算第i项 ... 阅读全文
摘要:
用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。 public class Solution { Stack<Integer> stack1 = new Stack<Integer>(); Stack<Integer> stack2 = new Stack<Int 阅读全文