
剑指offer
历尽千帆_SLAM
HIT
展开
-
【剑指offer】斐波那契数列
#include <iostream> using namespace std; class Solution { public: int Fibonacci(int n) { if(n == 0) return 0; else if(n == 1) return 1; // els...原创 2018-11-28 20:27:07 · 192 阅读 · 0 评论 -
【剑指offer】二维数组中的查找
#include <iostream> #include <vector> using namespace std; class Solution{ public: bool Find(int target, vector<vector<int>> array){ int nRow = array.size();//这里是...原创 2018-11-28 15:54:08 · 255 阅读 · 0 评论 -
【剑指offer】用两个栈实现一个队列
自己用了个笨方法 class Solution { public: void push(int node) { stack1.push(node); } int pop() { int num; int siz = stack1.size();//!!! for(int i = 1; i <...原创 2018-12-14 12:23:43 · 128 阅读 · 1 评论