- 博客(11)
- 收藏
- 关注
原创 剑指Offer 第五题 替换空格
#include <iostream> using namespace std; void replaceBlack(char str[], int length) { if (str==nullptr || length<=0) { cout << "请输入正确的字符串!" << endl; return; } int origi...
2018-02-10 00:52:11
194
原创 剑指Offer 第四题
//剑指Offer第四题 二维数组中的查找 //哈工大-周兴-qq960020310 #include <iostream> using namespace std; bool findInt(int **a, int width, int height, int targrtNumber) { int colStart = 0; int rowStart = 0; in...
2018-02-09 23:24:22
361
转载 指针数组与数组指针
指针数组与数组指针详解1.什么是指针数组和数组指针?指针数组:指针数组可以说成是”指针的数组”,首先这个变量是一个数组,其次,”指针”修饰这个数组,意思是说这个数组的所有元素都是指针类型,在32位系统中,指针占四个字节。数组指针:数组指针可以说成是”数组的指针”,首先这个变量是一个指针,其次,”数组”修饰这个指针,意思是说这个指针存放着一个数组的首地址,或者说这个指针指向一个数组的首地址。 根据上...
2018-02-09 23:23:46
153
原创 剑指Offer-面试题3 数组中重复的数字
//剑指Offer第三题 //哈工大周兴 //联系:qq960020310 #include <iostream> using namespace std; /* //插入排序 bool insertSort(int *a,int len) { if (a==nullptr) { return false; } for (int i=0;i<len;i++) { for (i...
2018-02-09 21:03:58
234
原创 散列的实现
#define _CRT_SECURE_NO_WARNINGS #include #include #define HASHSIZE 12 //定义散列表数组的长度 #define ERROR 0 #define OK 1 #define NULLKEY -32768 #define UNSUCCESS 0 #define SUCCESS 1 typedef struct { int
2018-02-07 19:51:59
267
原创 c++ 输入流cin深入解析
cin从输入缓冲区读取数据,有多重方式,如:>>、get()、getline()等 1.>> 根据后面的变量类型读取数据 读取时结束条件为:回车、空格、tab 对结束符的处理:丢弃 测试: #include using namespace std; int main(void) { char str[3]; cin >> str; cout << str << end
2018-02-05 16:57:24
276
原创 迪杰斯特拉最短路径算法
/**************************************************************************/ /* 算法实现作者:xingzhou */ /* 完成时间:2018/2/4
2018-02-05 14:52:29
926
原创 图的邻接多重表存储
#define _CRT_SECURE_NO_WARNINGS #include #include "stdio.h" #define MAX_VEX_NUM 20 enum E_VisitIf { unisited = 0, visited=1, }; //弧节点 struct ArcNode { E_VisitIf mark; int iIndex, jIndex;//顶点i
2018-02-04 16:18:24
510
原创 图的邻接表存储实现c语言
#define _CRT_SECURE_NO_WARNINGS #include #include #define MAXSIZE 100 #define INFINITY 65535 typedef char VertexType; /*顶点类型char*/ typedef int Arc;/*边的类型int*/ //邻接表的节点 typedef struct AdjListNode_
2018-02-02 19:32:31
546
原创 图的邻接矩阵实现c语言
#define _CRT_SECURE_NO_WARNINGS #include #include #define MAXSIZE 100 #define INFINITY 65535 typedef char VertexType; /*顶点类型char*/ typedef int Arc;/*边的类型int*/ typedef struct MGraph { VertexType
2018-02-02 17:00:24
479
原创 机器学习梯度下降:可变学习率,回溯线性,二次插值
#f(x)=x^2 import numpy as np import matplotlib.pyplot as plt def f(x): return x*x def Get_fai_Armijo(x,d,fai): c1=0.3 now=f(x) next=f(x-fai*d) for i in range(30): if next<
2017-11-15 00:28:55
709
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人