自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

浪里寻星

Open Free Share

  • 博客(14)
  • 问答 (1)
  • 收藏
  • 关注

转载 C++初始化列表 作者:DirectX 大牛

何谓初始化列表与其他函数不同,构造函数除了有名字,参数列表和函数体之外,还可以有初始化列表,初始化列表以冒号开头,后跟一系列以逗号分隔的初始化字段。在C++中,struct和class的唯一区别是默认的访问性不同,而这里我们不考虑访问性的问题,所以下面的代码都以struct来演示。struct foo{ string name ; int id ; foo(s

2015-06-22 00:48:54 388

原创 对java多线程的一点思考

关于java多线程的一点思考

2015-06-19 17:26:58 825

转载 Java中的静态块语句、块语句精研

以下是一道笔试题: Java代码  package com.example;    public class Parent  {      public Parent()      {          System.out.println("Parent>>>>>>>>>>>1");      }        {       

2015-06-18 17:01:45 419

原创 树变成二叉树

/*问题描述:将树变成二叉树引例:《数据结构(C语言版)》清华大学出版社P135下图input.data 数据如下:10RARBRCRDAEAFCGFHFKF */#include #include #include #define MAX_TREE_SIZE 20typedef char TElemType; typedef

2014-12-13 17:03:19 571

原创 线性代数·矩阵的加法减法乘法运算简单实现

#include #include typedef int Array_Size;typedef struct matrix{ Array_Size ** array; int line; int cow;}Matrix;void Addition(Matrix &A,Matrix &B);//加法运算 A+B=C void Subtraction(Matrix &A,Mat

2014-12-11 15:39:52 1767

原创 哈夫曼树-贪心算法的应用实例

/**哈夫曼编码-链式结构* *功能实现: * 源文件字符权值确认操作 * 哈夫曼树的建立操作 * 字符字典的建立操作 * 源文件转码操作操作 * 二进制文件译码操作* 文件输出操作* 内存清理操作 */#include #include #define _HFMAlgorithm_#define codesize 30//哈夫曼树结点定义 typedef s

2014-12-07 23:11:35 3834

原创 特殊情况下的排序算法(一)

有1,2,…,n的无序数组,求排序算法,并且要求时间复杂度为O(n),空间复杂度O(1),使用交换,而且一次只能交换两个数。#include int main() { int a[] = {10, 6, 9, 5, 2, 8, 4, 7, 1, 3}; int i, tmp; int len = sizeof(a) / sizeof(a[0]); for(i

2014-12-05 23:11:13 383

原创 一个简单的指针指向问题的讨论

#include#include#includetypedef struct node{ int data; struct node * next; }Link;int main(void){ Link l[3]; //建立三个结点,分别存储1,2,3和自己的地址 for(int i=0;i<3;i++){ l[i].data = i+1; l[i].next =

2014-12-03 19:36:55 428

原创 N皇后问题的简单实现

//N皇后问题的简单实现#include#include#includevoid PrintTheSulotion(int *Queen,int n){ for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(j-Queen[i]) printf("O "); else printf("X "); } p

2014-11-29 00:12:36 277

原创 我的小记_初学python之装饰器的实现

#我的小记_初学python之装饰器的实现import timeimport osdef timeit(func): def wrapper(): start = time.clock() func() end = time.clock() print(end - start) return wrapper@timeitdef hello(): print('hel

2014-11-25 21:09:08 335

原创 装箱问题的简单实现

//装箱问题的简单实现#include #include #include using namespace std;typedef struct{ int gno; int gv;}Goods;class GNode{ private: int gno; GNode * link = NULL; public: GNode(int gno){ this->

2014-11-24 02:09:34 640

原创 散列查找:C语言线性探查与拉链存储的实现

//散列查找:C语言线性探查与拉链存储的实现 #include #include #define LineSize 13typedef struct node{ int data; struct node *next;}ElemSN;//线性探查法存储 int * LinearProbing(int d[],int n){ int * const Plp = (int *

2014-11-03 02:24:37 684

原创 冒泡升序排序的数组实现和链表实现

void ArrayBubbleSort (int a[],int n){ int i,j,t,tag = 1; for(i = 1;i < n && tag;i++){ tag = 0; for(j = n-1;j >= i;j--) if(a[j-1] > a[j]){ t = a[j-1]; a[j-1] = a[j]; a[j] = t;

2014-11-01 01:51:34 407

原创 二叉搜索树非递归后序遍历的尝试

//非递归后序遍历void Porder2(BTNode * root) { BTNode **s; BTNode *sr;//右子树结点访问标记 BTNode *p; int top = -1; int tag = 0; s = (BTNode **)malloc(100 * sizeof(BTNode *)); p = root; do{ while(p && !

2014-10-29 01:04:03 357

空空如也

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

TA关注的人

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