自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(81)
  • 收藏
  • 关注

转载 面试题:如何删除单链表的重复结点

转自:http://www.nowamagic.net/librarys/veda/detail/1846写一算法将单链表中值重复的结点删除,使所得的结果表中各结点值均不相同。解决的思路如下:建立指针p,用于遍历链表;建立指针q,q遍历p后面的结点,并与p数值比较;建立指针r,r保存需要删掉的结点,再把需要删掉的结点的前后结点相接。由此去掉重复值。具体代码实现为:

2015-06-25 17:57:03 2639

原创 动态网页技术

参考:韩顺平的servlet学习视频动态网页技术的发展当www网出现的时候,主要是html(1993),由于html只支持静态的文字和图片,不能与用户进行交互。之后开始出现以下技术(1)cgi(common gateay interface)是早期动态技术使用最多的,发展的比较成熟并且功能强大但是效率比较低,编程比较困难可以使用vb,delphi,c/c++,perl等编写

2015-06-22 22:23:40 550

原创 HTML初识

本文学习来自W3School:http://www.w3school.com.cn1、什么是HTML?HTML是超文本标记语言(Hyper Text Markup Language),是用来描述网页的一种语言。HTML不是编程语言,而是一种标记语言,是一套标记标签(markup tag)。HTML正是使用标记标签来描述网页的。HTML标记标签通常被称为HTML标签(HTML tag),

2015-06-07 20:34:05 325

原创 《大话数据结构》串的匹配算法--朴素模式匹配算法,KMP模式匹配算法及其改良算法

#include #include #include #define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define MAXSIZE 100 /* 存储空间初始分配量 */typedef int Status; /* Status是函数类型,其值是函数结果状态代码,如OK等 */typedef in

2014-12-08 10:49:18 452 1

原创 命名空间的使用

在header1.h中#include using namespace std;namespace student1{ class Student { public: Student(int n,string nam,int a,string addr) { num = n; nam

2014-12-06 17:05:55 245

原创 区别异常处理调用析构函数与正常调用析构函数

#include using namespace std;class Student{public: Student(int n,string nam) { cout << "constructor-" << n << endl; num = n; name = nam; } ~Student(){cout

2014-12-06 16:40:52 235

原创 对输入输出串流的操作

#include #include using namespace std;struct student{ int num; char name[20]; double score;};int main(){ student stud[30]={1001,"Li",78,1002,"Wang",89.5,1004,"Fun",90},stud1[

2014-12-06 03:00:39 525

原创 对输入输出二进制文件流的操作

#include #include #include using namespace std;struct staff{ int num; char name[20]; int age; double pay;};int main(){ staff staf[7]={2101,"Li",34,1203,2104,"Wang",23,67

2014-12-06 02:39:09 837

原创 建立两个磁盘文件f1.dat和f2.dat,编程序实现以下工作

1)从键盘输入20个整数,分别存放在两个磁盘文件中,每个文件中放10个整数2)从f1.dat读入10个数,然后存放在f2.dat文件原有数据后面3)从f2.dat中读入20个整数,对它们进行从小到大的顺序存放在f2.dat中(不保留原来的数据)#include #include #include using namespace std;//fun1函数从键盘输入20个整数,分

2014-12-05 20:11:05 13387

原创 setfill、setw和setprecision用法

转发自某博客:http://blog.sina.com.cn/s/blog_6757fa030100o54z.htmlC语言用法:使用 setfill、setw 和 setprecision 操作器,这些操作器带有参数,并在头文件 iomanip.h 中定义。因此,此头文件必须包括在程序中。#include#include #includevoid main(){

2014-12-05 01:09:54 3168

原创 构造函数和析构函数的调用顺序

#include using namespace std;class A{ public: A(){cout << "constructing A " << endl;} ~A(){cout << "deconstructing A " << endl;}};class B:public A{public: B() {cout <

2014-12-04 17:40:44 287

原创 C++继承的一些结论

#include using namespace std;class student{public: void get_value() { cin >> num >> name >> sex; } void display() { cout << "num:" << num << endl; co

2014-12-04 17:14:27 309

原创 编写程序处理一个复数与double数相加的运算,输出相应的double实数以及复数。

#include using namespace std;class Complex{public: Complex(){real=0;image=0;} Complex(double r){real=r;image=0;} Complex(double r,double i){real=r;image=i;} operator double(){ret

2014-12-04 01:42:37 2980 2

原创 类模版的使用例子

#include using namespace std;template //声明类模版,虚拟类型名numtypeclass Compare{public: Compare(numtype a,numtype b) { x=a; y=b; } numtype max() { r

2014-11-27 23:51:53 376

原创 构造函数析构函数的调用顺序

#include #include using namespace std;class Student{public: Student(int n,string nam,char s) { num = n; name = nam; sex = s; cout << "Constructor called"

2014-11-27 20:47:16 254

原创 inline函数以及类中的函数(代码)是不占用内存空间的,类成员函数的声明和定义使用

#include using namespace std;class Student{ int num; //sizeof(int)是4public : char name[20]; //sizeof(char [20])是20 char sex; //对齐,所以内存占用空间大小变为4,和int内存大小对其 void display

2014-11-27 16:11:16 981

原创 new和delete的使用以及struct结构体是使用

#include #include using namespace std;struct Student{ string name; int num; char sex;};int main(){ Student *p; p = new Student; //用new运算符开辟一个存放Student类型的数据指针变量p p ->

2014-11-27 02:04:18 4434 1

原创 “引用”reference的使用:交换两个数

#include using namespace std;int main(){ int a = 10; int &q = a; //这里声明了一个引用,q是a的别名,q和a都是同一个内存单元 int *p = &a; //这里的&a是地址,&是地址运算符,要区别于引用声明符。 int b=13; void swap(int &,int &

2014-11-27 01:41:07 400

原创 const指针的用法

#include using namespace std;int main(){ void fun(int *); int a = 10; int b = 23; int * const p=&a; // p = &b; //无法通过编译 const int * const q = &a; a=33; //合法 //*q=21

2014-11-27 01:03:49 208

原创 若干字符串按字符串顺序(由小到大)输出(涉及字符串数组指针以及指向指针的指针运用的错误方式)

#include #include using namespace std;int main(){ void sort(char **, int); void print(char **, int); char *name[] = {"BASIC","FORTRAN","C++","Pascal","COBOL"}; //这里的name明显是指向字符型数组的指针

2014-11-27 00:29:04 611

原创 对两个整数进行交换操作

#include using namespace std;int main(){ void swap(int *,int *); void swap1(int,int); void swap2(int *,int *); void swap3(int &,int &); int a=45,b=78; int * pointer_1,* po

2014-11-26 11:59:03 259

原创 能够实现两数在函数中成功交换的两种方法

/* 实现两个数在函数成功交换的两种方法 */#include #include using namespace std;int swap(int &p,int &q){ int temp; temp=p; cout << "------------------swap方法体内" << endl; cout <<"swap方法使用的是地址对应的值交换" << endl;

2014-11-20 01:12:50 562

原创 基于指针的指针的一些想法

问题来源:《大话数据结构》书中有关#270楼   @jennyBaBy引用@伍迷老师 您好 我有个问题一直想不通 ,就是您前面的那个链表代码的初始化代码是:Status InitList(LinkList *L) { *L=(LinkList)malloc(sizeof(Node)); /* 产生头结点,并使L指向此头结点 */if(!(*L)) /

2014-11-12 22:21:04 263

转载 MyEclipse快捷键大全[转载]

-------------------------------------MyEclipse 快捷键1(CTRL)-------------------------------------Ctrl+1 快速修复Ctrl+D: 删除当前行 Ctrl+Q  定位到最后编辑的地方 Ctrl+L  定位在某行  Ctrl+O  快速显示 OutLine Ctrl+T  快速

2014-10-15 11:00:59 187

转载 hbm.xml配置说明

百度文库:http://wenku.baidu.com/link?url=eqAZ0VKvUxNo7vduzhl_oO-3SGn8QL4E6hblLk48pu_N7jwCOaWZAezFpmTkgYLKpqxNoxmSa7cySX3I_V1MT9GW-ooAuz-xZCxSFM_iCuG

2013-11-22 09:57:33 636

原创 Struts学习笔记

1、 2、在一个类中重写一个函数,可用快捷键Alt+. 找到可以重写的函数。

2013-11-20 19:27:38 428

原创 Struts

Struts基本概念:Struts是基于web的一个MVC框架。好处:程序规范化。效率提高。程序可读性增强。可维护性增加。约束程序员的自由。不足:form表单有点鸡肋,action是单态。

2013-11-16 14:02:58 283

原创 Android数据存储

Android中一共提供了4种数据存储方式:Shared Preferences:用来存储“key-value paires”格式的数据,它是一个轻量级的键值存储机制,只可以存储基本数据类型。Files:他通过FileInputStream和FileOutputStream对文件进行操作。但是在Android中,文件是一个应用程序私有的,一个应用程序无法读写其他应用程序的文件。SQLi

2013-11-09 19:39:20 276

原创 SQLite数据库

Android系统集成了一个轻量级的数据库:SQLite,SQLite并不想成为Oracle、MySQL那样专业的数据库。SQLite只是一个嵌入式的数据库引擎,专门适用于资源有限的设备上适量数据存取。SQLite支持绝大部分SQLite92语法,也允许开发者使用SQL语句操作数据库中的数据,但SQLite并不像Oracle、MySQL数据库那样需要安装、启动服务器进程,SQLite数据库只是

2013-11-09 19:21:03 476

原创 MP3播放器

TabActivity的使用按下TabWiget后对于文件读取的更新在onResume方法中写入,同样在onCreate中也要有。

2013-11-06 08:15:44 294

转载 hibernate hbm xml详解

http://www.doc88.com/p-947592578317.html

2013-11-02 21:35:21 286

转载 JDOM重要API【转】

JDOM的处理方式有些类似于DOM,但它主要是用SAX实现的,不必担心处理速度和内存的问题。另外,JDOM中几乎没有接口,类全部是实实在在的类,没有工厂类的。数据输入要用到XML文档要通过org.jdom.input包,反过来需要org.jdom.output。API如下:SAXBuilder.build(FileInputStream("*.xml");—

2013-11-02 20:32:28 288

转载 71道经典Android面试题和答案

http://my.eoe.cn/1124639/archive/17887.html

2013-10-30 11:46:09 870

转载 Android面试题整理【转载】

http://www.apkbus.com/android-115989-1-1.html面试的几个回答技巧http://blog.sina.com.cn/s/blog_ad991b1601018mjc.html2013-5-9号补充:今天最新的腾讯面试题,应该说是所有面试中最难的,我个人感觉。而且是个女面试官,好嗨皮啊,哈哈。腾讯面试题1.in

2013-10-30 11:44:22 16097 1

原创 Android面试题

1, 谈谈你对Activity的理解?        Activity是Android应用的重要组成单元之一(另外三个是Service、BroadcastReceiver和ContentProvider),而Activity又是Android应用最常见的组件之一。实际的应用中往往包括多个Activity,不同的Activity向用户呈现不同的操作界面。Android应用的多个Activity组

2013-10-30 08:39:45 3148

原创 单例模式

单例模式(Singleton):保证一个类仅有一个实例,并提供一个访问它的全局访问点。UML图:Singleton类:class Singleton{ private static Singleton instance; private Singleton() { } public static Singleton GetInstance() {

2013-10-27 10:16:37 314

原创 适配器模式

适配器模式(Adapter):将一个类的接口转换成客户希望的另外一个接口。Adapter模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作。

2013-10-27 09:28:24 347

原创 观察者模式

观察者模式又叫发布-订阅(Pubilsh/Subscribe)模式。观察者模式:定义了一种一对多的依赖关系,让多个观察者对象同时监听某一个主题对象。这个主题对象在状态发生变化时,会通知所有观察者对象,使它们能够自动更新自己。

2013-10-27 09:08:57 301

原创 Socket

Socket通常也称作“套接字”,用于描述IP地址和端口,是一个通信链的句柄。应用程序通常通过“套接字”向网络发出请求或者应答网络请求。

2013-10-24 17:12:59 270

原创 Bound Service

该代码来自Mars老师的Android视频。1、新建一个S01E26_Service01的Android项目。2、新建一个SecondService的类,该类继承Service。onBind方法是继承Service方法必须复写的方法。新建一个内部类FirstBinder继承于Binder,当中的getData方法返回一个字符串。在onBind方法中新建一个IBinder对象,利用向

2013-10-24 17:02:52 1093

空空如也

空空如也

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

TA关注的人

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