- 博客(15)
- 资源 (4)
- 收藏
- 关注
原创 C++实现折半插入排序
在“C++实现直接插入排序 ”中,由于插入排序的基本操作是在一个有序表中进行查找和插入,则这个“查找”操作可以利用“折半查找”来实现,由此进行的插入排序称之为折半插入排序实现如下:#includeusing namespace std;#define SIZE_A 9int main(){ void myshow(int* p,int length);//函数提前声明
2015-04-29 16:52:43 2214
原创 C++实现直接插入排序
#includeusing namespace std;#define SIZE_A 9int main(){ void myshow(int* p,int length);//函数提前声明 int list[SIZE_A]={-1,49,38,65,97,76,13,27,49}; cout<<"排序前:"<<endl; myshow(list,SIZE_A); //直接
2015-04-29 15:54:52 1517
原创 两个有序线性表的合并(线性表使用 Vector表示)
#include#includeusing namespace std;#define SIZE_A 2#define SIZE_B 3#define SIZE_AB SIZE_A+SIZE_B //2+3=5int main(){ void showVector(vector *vector_p);//函数提前声明 vector list_a; vector list_b
2015-04-29 11:07:12 1878
原创 C++实现两个矩阵相乘
#includeusing namespace std;#define SIZE_M 2#define SIZE_N 3#define SIZE_S 4int main(){ int matrix_a[SIZE_M] [SIZE_N]={{1,2,3},{4,5,6}};//a矩阵2X3 int matrix_b[SIZE_N] [SIZE_S]={{1,2,3,4},{5,6,
2015-04-29 10:31:47 35708 1
原创 C++中变量使用前一定要初始化
在C++中变量声明后,在使用前一定要初始化。1>如下代码:#includeusing namespace std;int main(){ for(int i=0;i<100;i++){ int sum;//这里只是声明,未进行初始化 for(int j=1;j<100;j++){ sum+=j; } cout<<"sum["<<i<<"]:"<<sum<<
2015-04-16 16:00:36 4275 1
原创 Android 自定义Adapter以实现自定义填充ListView的Item
1>实体类---即ListView中各个Item中填充的内容package com.demo.cxc.compoundview.com.demo.cxc.entity;import java.text.SimpleDateFormat;import java.util.Date;/** * Created by CXC on 15/4/14. */public class To
2015-04-15 00:42:23 3775
原创 Android复合控件创建与使用Demo
1>创建复合控件1.1>属性值类型声明 1.2>复合控件布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:la
2015-04-13 21:13:11 811
原创 Activity动态增加Fragment
运行效果如下整个程序分为两部分:1>第一部分NewItemFragment效果如下:1.1>布局文件如下:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" and
2015-04-11 23:58:26 2093
转载 Namespaces
when two identifiers (variable and/or function names) with the same name are introduced into the same scope. When this happens, anaming collision will result, and the compiler will produce an error
2015-04-10 17:32:35 565
转载 Interface classes
An interface class is a class that has no members variables, and where all of the functions are pure virtual!(接口类是一个没有任何成员变量并且所有的函数都是纯虚函数的类。) In other words, the class is purely a definition, and
2015-04-10 15:10:26 524
转载 虚函数(Virtual Function)与 纯虚函数(Pure Virtual Function)
1>虚函数(Virtual Function)1.1>Base Class #ifndef Animal_h#define Animal_h#include class Animal{protected: std::string m_strName; // We're making this constructor protected because // we don'
2015-04-10 14:25:42 1603
转载 What and where are the stack and heap?
The stack is the memory set aside as scratch space for a thread of execution. When a function is called, a block is reserved on the top of the stack for local variables and some bookkeeping data.
2015-04-10 09:28:45 421
转载 Memory : Stack vs Heap
Stack vs HeapSo far we have seen how to declare basic type variables such as int,double, etc, and complex types such as arrays and structs. The way we have been declaring them so far, with
2015-04-10 09:12:15 1082
原创 C++基类与派生类的转换与多态性
1》首先建立一个基类Student类头文件Student.h 如下:#ifndef Student_h#define Student_h#includeusing namespace std;/*基类Student头文件*/class Student{protected: int num; string name; float score;public: Stu
2015-04-09 11:41:19 865 2
转载 Convolutional Neurons Network 训练参数与连接数计算过程
1.C1层是一个卷积层(为什么是卷积?卷积运算一个重要的特点就是,通过卷积运算,可以使原信号特征增强,并且降低噪音),由6个特征图Feature Map构成。特征图中每个神经元与输入中5*5的邻域相连。特征图的大小为28*28,这样能防止输入的连接掉到边界之外(是为了BP反馈时的计算,不致梯度损失,个人见解)。C1有156个可训练参数(每个滤波器5*5=25个unit参数和一个
2015-04-03 17:33:41 2130
Android图表--achartengine
2014-10-26
SmartUpload上传及下载
2014-09-12
JFreeChart使用相关
2014-09-11
DAO设计模式Demo
2014-09-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人