自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

转载 监督学习应用与梯度下降

文章转载自http://blog.sina.com.cn/s/blog_8e6f1b330101eu3b.html 监督学习:告诉算法每个样本的正确答案,学习后的算法对新的输入也能输入正确的答案 。监督指的是在训练样本答案的监督下。1、 线性回归例:Alvin汽车,先让人开车,Alvin摄像头观看(训练),而后实现自动驾驶。本质是一个回归问题,汽车尝试预测行驶方向。

2015-01-03 16:13:42 393

原创 c++primer第五版课后练习答案(第六章)

chapter6_6.3int fact(int val){ int ret = 1; while (val > 1) ret *= val--; return ret;}chapter6_6.4#include "stdafx.h"#include using namespace std;int fact(int val){ int ret = 1; w

2014-12-18 20:09:53 864

原创 MFC实现一个简单的计算器

在VS2013环境下用MFC实现一个简单的计算器,主要是为了熟悉MFC编辑框的使用和消息传递机制。实现步骤:1、在工具箱托两个Edit control,一个显示可见,另一个不可见(用于保存操作数),分别为其添加CString类型的变量m_str1,m_str22、添加button按钮,分别表示0—9,左击添加响应处理函数void Cdemo2Dlg::OnBnClicked

2014-12-12 14:55:04 10473 5

原创 c++primer第五版课后练习答案(第十章)

chapter10_10.1#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ vector ivec = {1,2,3,2,5,6}; int num = 0; num = count(ivec.cbegin(),

2014-12-09 15:14:17 691

原创 MFC实现一个简单的加法器

在MFC中实现一个简单的加法器工具:Visual Studio 2013步骤:1、打开VS2013,选择文件->新建项目->项目,选择MFC程序,项目名称为Add,点击确定,MFC应用程序向导对话框,选择“应用程序类型->基于对话框”,其他选项保持默认值不变,点击完成。2、编辑对话框资源将相应控件添加到相应位置,如图所示3、向应用程序加入成员函数

2014-12-08 19:04:18 7028

原创 LeetCode—Remove Duplicates from Sorted Array II

题目:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should return length = 5, and A is now 

2014-11-24 20:20:48 307

原创 LeetCode—Remove Duplicates from Sorted Array

题目Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in plac

2014-11-24 19:31:11 318

原创 LeetCode—Swap Nodes in Pairs

题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant

2014-11-10 16:39:26 337

原创 c++primer第五版课后练习答案(第九章)

chapter9_9.3

2014-11-08 19:38:33 688

原创 基于TCP网络应用的入门小程序

基于TCP(面向连接)的socket编程的服务器程序流程如下:1、

2014-11-08 13:26:17 413

原创 LeetCode—Merge Two Sorted Lists

题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.解题思路:此处要求

2014-10-31 15:55:13 325

原创 LeetCode—Length of Last Word

题目:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A

2014-10-31 14:46:06 330

原创 LeetCode—TowSum

题目:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the

2014-10-30 22:42:27 458

原创 LeetCode——Merge Sorted Array

Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from

2014-10-30 21:06:44 296

原创 LeetCode——Remove Element

题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new lengt

2014-10-27 14:54:20 281

原创 LeetCode—Search Insert Position

题目:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the

2014-10-27 14:53:36 281

原创 LeetCode—Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ext

2014-10-26 21:23:45 291

原创 c++primer第五版课后练习答案(第五章)

chapter1_5.14

2014-10-26 15:03:38 736

原创 c++primer第五版课后练习答案(第三章)

chapter1_2.3

2014-10-20 21:50:37 869

原创 c++primer第五版课后练习答案(第一章)

最近一段时间在看c++primer第五版,准备后

2014-10-19 10:31:19 838

原创 vc环境下的窗口程序

#include#includeLRESULT CALLBACK WndProc(HWND hMainWnd,UINT message,WPARAM wParam,LPARAM lparam);char szClassName[]="windowscalss1";//窗口结构体名称char szAppTitle[]="windows API";int WINAPI WinMain(HIN

2014-09-25 15:43:03 436

原创 c++学习笔记之构造函数和析构函数

构造函数:当一个类的对象

2014-09-22 14:38:34 407

原创 统计相同数字的个数

/*程序读入一个int数组,假定数组项小于50,输出结果为两列:第一列是各个不同的数组元素,第二列是每个元素在数组中出现的次数的总和。第一列中的内容应该是从大到小排序。例如:对于数组值:-12,3,-12,4,1,1,-12,1,-1,1,2,3,4,2,3,-12输入形式:N     Count4     23     32     21     4

2014-09-14 13:52:19 738

转载 实参和形参的区别和用法

#include using namespace std;void getNum(int &a,int &b){ cout<<"输入两个数:"<<endl; cin>>a>>b;}void changeNum(int &c,int &d){ int temp; temp=c; c=d; d=temp;}void show(int e,

2014-09-12 21:41:17 1083

原创 图的深度优先遍历算法

#include #include #define MAXVEX 100typedef struct{ char vexs[MAXVEX]; int arc[MAXVEX][MAXVEX]; int numVertexes,numEdges; //顶点数和边数}MGraph;void CreateMGraph(MGraph *G){ int

2014-09-12 19:28:51 345

原创 c语言实现单链表创建和遍历

#include#includetypedef struct Node{ int data; struct Node *next;}Node,*Linklist;Node *creat_List_a()//尾插法建立单链表{ Linklist L; Node *p; int temp; L=(Linklist)malloc(sizeof(

2014-09-06 21:32:28 648

原创 JDBC连接MySQL数据库及示例

import java.sq;.*;public class demo{ public static void main(String [] args) throws Exception { String driver="com.mysql.jdbc.Driver"; String url="jdbc:mysql//localhost:33306/mydb" String

2014-05-17 13:23:59 473

原创 Java学习小问题

“hello”直接量和new string (“hello”)的区别?答:当Java程序直接使用形如“hello”的字符串常量,JVM将会使用常量池来管理这些字符串;当使用new string (“hello”)时,JVM会先使用常量池来管理直接量,再调用String类的构造器来创建一个新的String对象,新创建的String对象被保存在堆内存中。换句话说,new string (“he

2014-04-09 14:18:43 358

原创 快速排序Java语言实现

//快速排序;public class Demo{public static void main(String[] args){try{int a[]=new int[]{1,5,7,9,12,4};for(int i=0;iSystem.out.println(a[i]);System.out.println("------------");qSort

2014-04-09 14:04:03 396

原创 在数组中查找某一指定数组元素

在数组中查找某一指定数组元素,可设查找标志flag在数组s[n]中查找tempint flag=0;for(int i=0;i  {if(temp==s[i]){printf("数组含有该元素");flag=1;break;}    }if(flag==0)printf("数组不含有该元素");

2014-03-17 11:34:58 2304

原创 判断一个数是否为对称的数

方法一:int m;while(n)   {       m=m*10+n%10;       n=n/10;    }if(m==n)printf("是对称的");方法二:用栈判断int data[200],i=0,k,j;do { data[i++]=x%10;x=x/10; }while(x>0);for(j=0,k=i-1

2014-03-17 11:31:34 10381 3

空空如也

空空如也

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

TA关注的人

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