自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 问答 (2)
  • 收藏
  • 关注

原创 array,pointer and reference

指针什么是指针呢? 指针是c语言中很关键的一个概念。下面我举例子说明一下: 假设你是xx公司的经理,你的名字叫王明,你还有小名叫小王。 那么,你就可以用下面的表达式来表示: 经理 王明; 那么,指针怎么定义呢? 经理 xx公司 指针的类型是经理,指针存储的内容是你们公司的名字。那么这个其实说的就是你。当然,你们公司的经理可能还会换成别人。但是说到xx公司的经理,就是指某一个人的。

2015-05-06 22:36:47 456

原创 链接器相关问题

从.c文件到 可执行 文件需要经历的过程static linking静态链接器的输入是一组可重定向文件,输出一个全链接的可执行目标文件。 目标文件有三种形式: 1. 可重定向目标文件:包含二进制代码和数据,可以在编译时和其他可重定向目标文件一起,得到可执行文件。 2. 可执行目标文件:包含二进制代码和数据,可以直接拷贝进内存进行执行。 3. 共享目标文件:一种特殊的重定向文件,可以被加载进内

2015-04-02 08:05:36 913

原创 构造函数,析构函数和虚函数相关问题

构造函数要了解这个话题,首先我们给出一段代码:#include<iostream>using namespace std;class Animal{ int x;public: Animal(int x){ this->x = x; } virtual void eat(){ cout<<"eat"<<endl; }};

2015-03-28 10:19:26 440

原创 抽象基类和纯虚函数

上一节介绍了虚函数是如何来实现多态的。但现实中,有时候我们创建基类的目的可能只是为了实现up-casting的目的,并不会真正去创建一个基类的对象。在这个时候,抽象基类就产生了。抽象基类 怎样就可以叫抽象基类?它和别的基类的区别在哪?所谓的抽象基类就是包含至少一个纯虚函数的类。抽象基类只实现了接口的作用。无法创建抽象基类的对象。 那么纯虚函数是啥?它和虚函数有啥区别?所谓的纯虚函数就是

2015-03-25 20:55:52 535

原创 多重继承和虚函数

面向对象特点:抽象数据的封装,继承和多态。 封装的目的在于提供接口和实现的分离。封装通过组合特性和行为来生成新的数据类型。访问控制通过师细节数据设置为private,将接口从具体的实现中分离出来。 继承的目的在于实现代码的重用。 多态则是为了能够在运行时绑定具体的对象,实现对象行为的多样性。多态改善了代码的组织性和可读性,同时也使得创建的程序具有可扩展行。 下面详细解释关于多

2015-03-23 13:55:34 695

翻译 交叉验证(cross-validation)

定义 cross-validation,即交叉验证。它常常用来进行模型选择。所谓的n-fold交叉验证,就是将训练数据等分为n份,每次训练的时候,只使用n-1份,余下的数据来对训练得到的参数进行评估。形式化n-fold cross-validation我们用Θ \Theta 来表示参数向量。对于一个固定的值Θ\Theta,交叉验证的过程如下: 1. 首先,随机将一个大小为m的 给定样本集S划

2015-03-21 16:51:45 2616

原创 c语言中相关标准

保留标识符(Reserved identifiers)+All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.(留给库的实现者使用) +All identifier that begin wi

2015-03-12 11:28:03 449

原创 Best Time to Buy and Sell Stock IV

题目Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most k transactions.分析题目大意如下: 给定一个数组,这个数组记录

2015-03-08 10:50:40 385

原创 hadoop配置

注意事项 在配置ssh的无密码登录时和配置hadoop的时候,必须以相同的用户身份进行操作。这句话的意思是ssh和hadoop所在文件夹的创建者必须是相同的,否则在运行hadoop的时候,会提示输入密码 在配置hadoop的时候,需要对三个文件进行修改core-site.xml,mapred-site.xml及hadoop-env.sh。我主要参考下面的链接地址[http://www.cn

2015-03-06 15:34:45 336

原创 C语言中变量的生存期及作用域介绍

c 语言中变量的初始化及生存期、作用域浅谈生存期和作用域相关的关键字extern,static,auto,register 变量的初始化相关问题关键字介绍extern extern 可以作用于变量,函数。所谓的外部变量是指定义在所有函数之外的变量。一般有两种,一种是定义在同一文件中,另一种是定义在别的文件中。同一个文件中的所有函数可以使用该文件中定义的外部变量而不要求必须用extern进行声明

2015-03-06 09:08:06 1398

原创 python 程序运行时出现DLL load error

问题描述系统环境:win8系统,安装了64bit的python versin 2.7。同时正确安装了numpy,scipy,gensim的package.在程序的运行过程中,加载一个动态链接库时出错。那个库文件路径是c:/python2.7/lib/site-package/scipy/linalg/_fblas.pyd。结果无法加载,总是出现找不到对应模块的错误,但是在对应的文件路径下,

2015-02-04 15:48:41 1939

原创 [leetcode]Longest Valid Parentheses

题目:Longest Valid ParenthesesGiven a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid paren

2015-01-29 13:28:27 339

原创 python 配置篇

python配置篇  对于刚开始学习python的孩子来说,首先一个令人头大的问题就是如何搭建环境。姑且不去谈高大尙的IDE环境,我们只从简单的说起。  在一个系统中,可以安装多种版本的python。你可以同时安装python2.7和python3.4。我们这里只谈在win8下面如何来进行操作。打开window命令行:这显示了在默认的情况下,python版本为2.7。那么这些信息从

2015-01-27 21:13:03 394

原创 [leetcode oj]Maximum Product Subarray

题目:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the contiguous subarray [2,3] has the larg

2015-01-21 12:51:16 460

原创 [leetcode oj]Word Search

题目:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertica

2015-01-20 10:54:06 357

原创 [leetcode oj] LRU

#include#include#includeusing namespace std;class LRUCache{public: unordered_map::iterator> m; list priority; int cap; int size; LRUCache(int capacity) { cap = capacity; size = 0; }

2015-01-18 15:18:53 402

原创 [leetcode] wordBreak II

[题目]Given a string s and a dictionary of wordsdict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences. For example, givens

2014-10-16 09:46:11 418

原创 [leetcode] best time to buy and sell stock

题目:The best time to buy and sell stock (I) (II)  (III)题目描述:Say you have an array for which the ith element is the price of a given stock on dayi.If you were only permitted to complete at most

2014-10-14 16:55:04 535

原创 [leetcode] Sort List

题目描述:Sort a linked list in O(n log n) time using constant space complexity

2014-10-13 13:07:52 415

原创 [leetcode] distinct sequences

Given a string S and a string T, count the number of distinct subsequences ofT in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be none

2014-10-08 16:46:34 587

原创 leetcode gas station

There are N gas stations along a circular route, where the amount of gas at stationi is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from stationi to it

2014-10-07 17:00:53 380

空空如也

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

TA关注的人

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