自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

高万禄的博客

个人笔记 https://gaowanlu.gitbook.io

  • 博客(24)
  • 资源 (3)
  • 收藏
  • 关注

原创 JavaScript看这个就够了-入门基础篇

打印你的第一个hello world使用console.log()打印东西到控制台console.log("hello world");变量在ES6出现之前使用var来定义变量,但var定义变量作用域是全局的,对于编程语言来说这是比较不规范的。if(1){ var i=0;}console.log(i);对于C++这样的静态语言,则会报错i没有定义,在javascript中则是输出了0,而我们使用let定义变量。if(1){ let uselet=0;}//con

2021-01-30 20:47:07 340 3

原创 动态规划之编辑距离(2021/1/29)

程序输出样例s1: familys2: frames1: familys2: frame编辑距离: 4d[][]:0 1 2 3 4 51 0 1 2 3 42 1 1 1 2 33 2 2 2 1 24 3 3 3 2 25 4 4 4 3 36 5 5 5 4 4--------------------------------Process exited after 10.78 seconds with return val

2021-01-29 20:29:24 285

原创 动态规划之最长公共子序列(2021/1/28)

动态规划之最长公共子序列问题引入手写解析代码实现(C/C++)/*动态规划算法:最长的公共子序列 日期:2021/1/28 编码:高万禄 */#include<iostream>#include<vector>#include<cstdlib>using namespace std;//求解最长公共子序列函数 void LCSL(string&s1,string&s2,int**c,int**b){ //求解c

2021-01-28 21:57:27 306

原创 学习《简单粗暴TensorFlow2》

学习《简单粗暴TensorFlow2》官方文档:https://tf.wiki/zh_hans/basic/basic.html第一个tensorflow程序#导入tensorflow模块并为模块起一个别名import tensorflow as tf#在此我们就现为它起别名为tf,即TensorFlow的缩写A = tf.constant([[1,2],[3,4]])B = tf.constant([[5,6],[7,8]])C = tf.matmul(A,B)print(C)输

2021-01-26 22:42:28 1820 2

原创 分治法之大整数乘法(2021/1/26)

问题引入代码实现//大整数乘法 #include<cstdlib>#include<cstdlib>#include<cstring>#include<iostream>using namespace std;const int M =1000;//存放两个要乘的大数 char A[M];char B[M];struct Node{ char num[M]; int l;//记录长度 int c;//记录次幂 };//

2021-01-26 15:55:35 371

原创 Python OpenCV

import cv2import numpy as np# test opencv """print(cv2.__version__)img=cv2.imread("1.png")cv2.imshow("output",img)"""# 获得灰度图像def get_Gray(img): return cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)#高斯滤波def get_gaussianBlur(img,size): return cv2.G

2021-01-24 20:34:23 348 2

原创 分治法之快速排序(以及快速排序的优化)(2021/1/24)

问题引入快速排序以及其优化代码实现#include<iostream>#include<cstdlib>using namespace std;struct Data{ int flag;};//快速排序划分函数,返回基准元素最后的下标 int Partition(struct Data*list,int low,int high){ struct Data temp; int i=low,j=high,p=low; while(i<j){ //

2021-01-24 19:04:50 342

原创 分治法之合并排序(2021/1/23)

问题引入代码实现#include<iostream>#include<cstdlib>using namespace std;struct Data{ int flag;};void MergeFunction(struct Data*list,int low,int middle,int high){ //申请辅助空间 int size=high-low; struct Data*space=(struct Data*)malloc(sizeof(struc

2021-01-23 09:39:01 280

原创 分治法之二分查找(递归与非递归)(2021/1/22)

问题引入分治法三原则原问题可以分解为若干个规模比较小的相同子问题子问题互相独立子问题的解可以合并为原问题的解分治法基本解题流程分解->治理->合并二分查找算法(折半查找)故事代码实现#include<iostream>#include<algorithm>using namespace std;//抽象数据struct Data{ int flag;};//sort排序Data数组的比较函数bool compare(stru

2021-01-22 12:51:40 502

原创 使用EasyX体验一元线性模型

使用方法代码实现#include <easyx.h> // 引用图形库头文件#include <conio.h>#include<cstdio>#include<ctime>#include<cstdlib>#include<cmath>#include<vector>#include<iostream>void initWindow(void);void getRealPoint(f

2021-01-21 21:21:35 249

原创 贪心算法之Prim最小生成树(2021/1/21)

问题引入Prim生成最小树算法(邻接矩阵存储图)代码实现/*Create by Wanlu Gao* 2021/1/21 * 实现功能:* 在此程序中实现的为邻接矩阵存储图Prim最小生成树*/#include<iostream>#include<cstdlib>using namespace std;//定义无穷const int INF=9999; //存储图的顶点数 const int map_dot_num=7;//初始化邻接矩阵const i

2021-01-21 15:43:22 288

原创 贪心算法之哈夫曼树及其编码(2021/1/20)

问题引入哈夫曼树构建及其编码输出代码实现//哈夫曼树及其编码 #include<iostream>#include<cstdlib>#include<vector>using namespace std;//定义节点抽象数据结构struct HuffNode{ float weight;//节点权重 int parent;//节点的父节点下标 int lchild;//节点的左孩子下标 int rchild;//节点的右孩子下标 cha

2021-01-20 14:20:36 609

原创 贪心算法之迪科斯彻单源最短路径(2021/1/19)

问题引入迪科斯彻单源最短路径代码实现//迪科斯彻最短路径算法(单源最短路径)#include<iostream>using namespace std;//顶点个数const int CITY = 5;//定义无穷const int INF = 1000;//使用二维数组存储邻接矩阵//在此我们直接在源代码中添加邻接矩阵信息//为了是弄懂程序流程而非实际问题int map[CITY][CITY]={{INF,2,5,INF,INF},{INF,INF,2,6,INF

2021-01-19 13:22:20 266

原创 贪心算法之会议安排(2021/1/18)

问题引入代码实现//会议时间表//会议 1 2 3 4 5 6 7 8 9 10//开始时间 8 9 10 11 13 14 15 17 18 26 //结束时间 10 11 15 14 16 17 17 18 20 19//贪心策略:局部最优解,选择结束最早的//相容且最早结束#include<iostream>using namespace std;struct Meeti

2021-01-18 10:54:47 473

原创 贪心算法之背包问题(2021/1/17)

趣味故事问题:假设山洞有n种宝物,每种宝物有一定重量w和相应价值v毛驴运载能力有限,只能运走m重量的宝物,一种宝物只能拿走一样,宝物可以分割,怎样才能使毛驴运走宝物的价值最大呢?代码实现:#include<iostream>using namespace std;//第一眼看背包问题怎么和最优装载问题有些相似呢//它们都可以利用贪心策略来求解 //局部最优://选择性价比最大的宝物 int main(int argc,char**argv){ int i=0,j=0

2021-01-17 10:50:59 383

原创 加勒比海盗船-最优装载问题(2021/1/16)

问题引入代码实现#include<iostream>using namespace std;//函数功能:冒泡排序 void BubbleSort(int*list,int n){ int i=0,j=0; bool flag=0; for(i=0;i<n;++i){ flag=0; for(j=0;j<n-i-1;++j){ if(list[j]>list[j+1]){ flag=1; int temp=list[j];

2021-01-16 12:01:17 401

原创 贪心算法之冒泡排序(2021/1/16)

#include<iostream>using namespace std;/*冒泡排序是一种贪心算法策略每次总大问题中选择一个局部最优解然后问题规模进一步减小解决子问题的方法和上一次解决问题方法是一样的*/ void function(int*list,int n){ int i=0,j=0; bool flag=0; for(i=0;i<n;++i){ flag=0; for(int j=0;j<n-i-1;j++){ if(list[j]&gt

2021-01-16 11:37:57 532

原创 验证歌德巴赫猜想(2021/1/16)

#include<iostream>#include<cstdlib>#include<cmath>using namespace std;//验证任意大于2的偶数都可以表示成两个素数之和//判断一个数是否为素数/*算法流程:试除法 用 2、3、4、...、sqrt(n)去除n如果能被整除则为合数不能整除则为素数 */bool judge(int n){ //先对n进行判断 if(n<=1){ return 0; } if(n=.

2021-01-16 01:38:10 341

原创 (2021/1/16)爱因斯坦的阶梯

题目代码实现#include<iostream>using namespace std;void function_1(void){ int n=1; while(1){ if(n%2==1&&n%3==2&&n%5==4&&n%6==5&&n%7==0){ cout<<n<<endl; return; }else{ ++n; } }}void functio

2021-01-16 00:41:36 268

原创 马克思手稿中的数学题(2021/1/16)

问题描述代码实现#include<iostream>using namespace std;int main(int argc,char**argv){ //x+y+z=30 //3x+2y+z=50 //得2x+y=20 //进行遍历穷举 int x,y,z; for(x=1;x<=9;x++){ y=20-2*x; z=30-x-y; if(3*x+2*y+z==50){//满足要求的阶 cout<<"x y z:\n\t"&

2021-01-16 00:19:33 529

原创 求斐波那契数列的第n个数,时间复杂度O(n)、空间复杂度O(1)(2021/1/15)

题目求斐波那契数列的第n个数,时间复杂度O(n)、空间复杂度O(1)。#include<iostream>#include<cstdlib>using namespace std;//斐波那契数列递归算法//功能求斐波那契数列第n个元素 int Fib1(int n){ if(n<1){ return -1; } if(n==1||n==2){ return 1; }else{ return Fib1(n-1)+Fib1(n-2); }}

2021-01-15 23:25:02 736

原创 有64个格, 第1个格子里面1粒麦子, 第2个格子里面2粒麦子(2021/1/15)

题目:有64个格,第1个格子里面1粒麦子,第2个格子里面2粒麦子,第3个格子里面4粒麦子,第4个格子里面8粒麦子,第5个格子里面16粒麦子,。。。以此类推。。。。问放满前n个格子,需要多少麦子(1<=n<=11)#include<iostream>using namespace std;int main(int argc,char**argv){ int n; //输入n cin>>n; //判断n是否合法 if(n<=0||n&g

2021-01-15 20:54:32 3917

原创 计算 -1 1 -1 1 .... (-1)^n 计算前n项和(2021/1/15)

t# 题目计算 -1 1 -1 1 … (-1)^n计算前n项和#include<iostream>using namespace std;int main(int srgc,char**argv){ int n; cin>>n; if(n%2==0){ cout<<"sum is "<<0<<endl; }else{ cout<<"sum is "<<-1<<end

2021-01-15 20:52:21 595

原创 C++ EasyX 画函数第一象限图像

#include <easyx.h> // 引用图形库头文件#include <conio.h>#include<cstdio>#include<ctime>#include<cstdlib>#include<cmath>void initWindow(void);void getRealPoint(float* Point);class ml_Point {public: float _x, _y; floa

2021-01-14 23:02:05 1088

p2 矩阵消元 MIT线性代数手写 课程笔记 .pdf

MIT线性代数手写 课程笔记

2022-01-09

p1方程组的几何解释.pdf

MIT线性代数手写 课程笔记

2022-01-09

数字电路复习笔记.docx

数字逻辑复习笔记(桂林电子科技大学)

2020-12-21

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除