- 博客(8)
- 资源 (1)
- 收藏
- 关注
原创 剑指offer 07 斐波那契数列
// #include "stdafx.h" #include<iostream> #include<vector> using namespace std; class Solution { public: int Fibonacci(int n) { if (n <= 0) { return 0; } if (n == 1) { ...
2019-08-27 11:22:22 79
原创 剑指offer 06 旋转数组的最小数字
// ConsoleApplication26.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> #include<vector> using namespace std; class Solution { public:int minNumberInRotateArray(vector<i...
2019-08-27 10:01:34 90
原创 剑指offer第一版 05 倒序打印链表
// ConsoleApplication18.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> #include<vector> #include<algorithm> using namespace std; struct ListNode { int va...
2019-07-31 16:03:01 115
原创 剑指offer第一版 06 利用前序、中序数组构建二叉树
// ConsoleApplication19.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> #include<vector> #include<algorithm> using namespace std; struct TreeNode { int val; ...
2019-07-31 15:59:52 172
原创 剑指offer第一版 07 2堆栈实现队列
// ConsoleApplication20.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> #include<stack> #include<algorithm> using namespace std; class Solution1 { public: void push(i...
2019-07-31 15:52:37 79
原创 田忌赛马
#include "stdafx.h" #include <iostream>; #include <algorithm>; #include <vector>; using namespace std; int main() { vector<int>tianJi, qiWang; int numHorse; int result=0...
2019-07-31 15:46:15 250
转载 0交换排序
/** * 交换数组里n和0的位置 * array: 存储[0-n)的数组 * len: 数组长度 * n: 数组里要和0交换的数 */ extern void swap_with_zero(int* array, int len, int n); class Solution { public: /** * 调用方法swap_with_zero来对array进行排...
2019-07-30 21:51:26 287
原创 遍历最短路径
// ConsoleApplication21.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <stdio.h> #include <iostream> #include <math.h> int orderRoute[120][5]; int countRoute=0; u...
2019-07-30 21:39:22 593
一类大滞后时间系统的智能PID控制
2018-10-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人