自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 用Python 和 Java 写的Sunday字符串排序算法

Python import re# 采用Sunday算法的字符串匹配# 输入:模式串,匹配串# 输出:所有匹配模式的首字符地址def findBob(mode, match): positions = [] # 返回值 len_mode = len(mode) len_match = len(match) endIndex =

2014-10-31 23:17:25 711

原创 辛普森法求定积分

#include#includeusing namespace std;double f(double x);double getResult(double a, double b);int main(){ double a = 0; double b = 2; double result = getResult(a, b); cout << "3 * x^2 在 " <<

2014-10-19 22:16:18 7958 1

原创 雅可比迭代

package com.zhp.third.雅可比迭代;import com.zhp.common.Methods;/** * @author 郑海鹏 * @since 2014/10/19 11:22 * @email 284967632@qq.com */public class Jacobi { public static void main(String[] args

2014-10-19 11:47:15 1080

原创 矩阵求逆

首先要知道LU分解:

2014-10-18 21:27:44 1088

原创 第二次

package com.zhp.second.定点迭代;public class PointIteration { public static final double scale = 0.00000000001; public static void main(String[] args) { double startValue = 1.5; System.out.printl

2014-10-16 12:49:58 396

原创 二分法和试位法 java

package com.zhp.fist;public class One { final static double scale = 0.000000001; public static void main(String[] args) { double leftX = 1.0; double rightX = 1.5; System.out.println("二分法的结果

2014-09-24 13:03:41 1013

原创 分治法

package com.zhp.first;/** * 高斯消去法和LU分解 */public class GSLU { public static final int U = 0; public static final int L = 1; public static void main(String[] args) { /* * 解为: x = 1,

2014-05-18 09:12:54 561

原创 约瑟夫斯 俄国农夫

package com.zhp.减常因子;public class Josephus { public static void main(String[] args) { int total = 41; int answer = getResult(total); System.out.println("存活的人是:" +answer); } /** * @param

2014-05-17 12:03:16 1206

原创 高斯消去法

package com.zhp.变治法;public class 高斯消去法及LU分解 { public static void main(String[] args) { /* * 解为: x = 1, y = 0, z = -1 * 方程组: 2x - y + z = 1 4x + y - z = 5 x + y +z = 0

2014-05-17 11:58:17 941 3

原创 JAVA IO

package com.zhp.method.io;import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileReader;import java.io.FileWriter;public class _BufferedStream { p

2014-05-07 10:16:10 531

原创 20140313

package dynamic_programming;class Type { int sum; int begin; int end; Type(int sum, int begin, int end) { this.sum = sum; this.begin = begin; this.end = end; } Type copy() { return t

2014-03-13 12:43:28 476

原创 打飞机

#include#include#include#include#includeusing namespace std;/*=============== all the structures ===============*/typedef struct Frame{ COORD position[2]; int flag;}Frame;/*===========

2013-12-07 09:51:11 1358 1

原创 飞机模型

#include#include#include#include#includeusing namespace std;#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")static float Pi = 3.1415926;static float lookat_r = 10; /

2013-11-08 11:28:21 986

原创 Goods类

#include#include#includeusing namespace std;class Goods{private: public: const string name; float Weight; static float totalWeight; Goods(); Goods(string, float); static float getTotal

2013-10-29 20:18:05 829

原创 贪吃蛇

#include#include#include#include#includeusing namespace std;int GameOver=0;struct Body//蛇身(链表结构){ int x,y;//蛇身结点坐标 Body *next;//下一个结点};void SetPos(int i,int j)//设定光标位置{ COORD pos={i-1,

2013-10-18 22:26:39 751

原创 getline的应用

#include#includeusing namespace std;class Car{private: string make; int time;public: Car(); Car(string,int); void setm(string); void sett(int); string getm(); int gett();};Car::Car()

2013-10-18 17:15:58 452

原创 Vehicle类

Vehicle.h#includeusing namespace std;#includeclass Vehicle{private: float maxSpeed; float weight;public: void run(); void stop(); float getms(); float getw(); Vehicle(float,float);};

2013-10-02 18:58:38 1083

原创 PeoPle类

用到了上一篇文章的TDate类。TDate.h:#includeusing namespace std;int yearyn(int y);class TDate{private: int year,month,day;public: TDate(); TDate(int,int,int); void setDate(int,int,int); void addO

2013-09-30 13:31:35 694

原创 Goods类

Goods.h#includeusing namespace std;#includeclass Goods{private: static float weight; const string name;public: Goods(string); static void buy(float); static void sell(float); static fl

2013-09-29 20:48:33 995

原创 TDate类

#includeusing namespace std;int yearyn(int y);class TDate{private: int year,month,day;public: TDate(int,int,int); void setDate(int,int,int); void addOneDay(); void print() const;};TDate:

2013-09-27 10:49:40 1118

原创 判断两个三角形是否全等

tra.h#ifndef TRA_H#define TRA_H#endif typedef struct{ double x,y;}Coord;class Tra{public: Coord a,b,c; double len(Coord,Coord); Tra (Coord,Coord,Coord);private: };Coord getcoord()

2013-09-26 18:44:33 1392

原创 向量计算器

#includeusing namespace std;#includetypedef struct{ double x,y;}Coord;class Vector{private: Coord coord;public: Vector(Coord); Vector(double,double); Vector operator+ (const Vector &c);

2013-09-25 20:49:26 4015

原创 课程设计:用C语言编写的稀疏矩阵运算器(加、减、乘、求逆)

课程设计:用C语言编写的稀疏矩阵运算器,可对超过1000行的大矩阵执行加、减、乘、求逆运算。

2013-09-25 20:43:16 7983 1

原创 顺序栈的基本运算

#include#include#define maxsize 30typedef struct { char data[maxsize]; int top;}sqstack;//初始化void init_sqstack(sqstack **s){ *s=(sqstack*)malloc(sizeof(sqstack)); (*s)->top=-

2013-07-29 11:02:27 1001

原创 将两个升序排列的单链表合并为一个降序排列的单链表且不增加新的结点

#include#includetypedef struct node{ char data; struct node *next;}LNode;LNode *creat_linklist(){ LNode *p,*q,*head; int i,n; head=(LNode*)malloc(sizeof(LNode)); head->next=N

2013-07-29 11:00:45 6261

原创 逆置单链表

#include#includetypedef struct node{ char data; struct node *next;}LNode;LNode *creat_linklist(){ LNode *head,*p,*q; char x; head=(LNode*)malloc(sizeof(LNode)); head->next=

2013-07-29 10:53:48 520

原创 将有序表A、B合并为有序表C

#include#include#define maxsize 20typedef struct{ int data[20]; int len;}sqlist;sqlist *init_sqlist(){ sqlist *L; L=(sqlist*)malloc(sizeof(sqlist)); L->len=0; return L;

2013-07-29 10:10:54 2170

原创 静态链表的基本运算

#include#include#define maxsize 30typedef struct{ char data; int cursor;}SNode;void insert_list(SNode L[],int i,char x){ int j,j1,j2,k; j=L[0].cursor; if(i==1) { if(j=

2013-07-29 10:06:07 588

原创 双向链表的基本运算

#include#includetypedef struct dlnode{char data;struct dlnode *prior,*next;}DLNode;DLNode *creat_dlinklist(){ DLNode *head,*s; char x; head=(DLNode*)malloc(sizeof(DLNode));

2013-07-29 00:29:12 725

原创 单链表的基本运算

#include#includetypedef struct node{ char data; struct node *next;}LNode;//创建单链表LNode *creat_linklist(){ LNode *head,*p,*q; char x; head=(LNode*)malloc(sizeof(LNode)); he

2013-07-29 00:28:13 1347

原创 在表尾插入生成单链表

#include#includetypedef struct node{ char data; struct node *next;}LNode;LNode *creat_linklist(){ LNode *head,*p,*q; char x; head=(LNode*)malloc(sizeof(LNode)); head->next=NU

2013-07-29 00:25:36 810

原创 在表头插入生成单链表

#include#includetypedef struct node{ char data; struct node *next;}LNode;//在表头生成单链表void creat_linklist(LNode **head){ char x; LNode *p; *head=(LNode*)malloc(sizeof(LNode));

2013-07-29 00:11:12 921

原创 顺序表的基本运算

#include#include#define maxsize 20typedef struct{ int data[maxsize]; int len; }sqlist;/*顺序表的初始化*/sqlist *init_sqlist(){ sqlist *L; L=(sqlist*)malloc(sizeof(sqlist)); L->len=0

2013-07-28 23:32:13 730

空空如也

空空如也

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

TA关注的人

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