
数据结构
happy曾帅
这个作者很懒,什么都没留下…
展开
-
冒泡排序(2)
每次排序后是最小的一个在最上面,但是与之前写的那个有点区别,,原创 2014-10-29 15:11:45 · 412 阅读 · 0 评论 -
C++实现在一个字符串中寻找最大子串
C++实现寻找最大的子串原创 2014-10-30 19:21:29 · 2072 阅读 · 0 评论 -
C++实现图的邻接矩阵的创建以及其深度优先遍历和广度优先遍历
C++实现图的邻接矩阵的创建以及其深度优先遍历和广度优先遍历原创 2014-11-01 20:42:09 · 7404 阅读 · 1 评论 -
C++抽象数据类型,如何抽象
C++抽象数据类型,如何抽象原创 2014-11-01 21:16:15 · 816 阅读 · 0 评论 -
算法导论学习笔记-第十三章-红黑树
算法导论十三中红黑树的插入和删除操作转载 2014-10-31 16:22:31 · 493 阅读 · 0 评论 -
数据结构中图的邻接矩阵表示方法
数据结构中采用图的邻接矩阵的表示方法来构造图原创 2014-11-01 15:31:31 · 1626 阅读 · 0 评论 -
数据结构中用图的邻接矩阵的表示以及深度搜索
图的邻接矩阵的表示以及其深度搜索原创 2014-11-01 16:51:55 · 716 阅读 · 0 评论 -
完整的C++实现算法导论十三章红黑树以及十四章中的顺序统计树
#includeusing namespace std;class BRTree;class BRTreeNode{private: friend class BRTree; int key; bool color; int size; BRTreeNode *left; BRTreeNode *right; BRTreeNode *parent;public: //创原创 2014-11-06 14:14:17 · 956 阅读 · 0 评论 -
C++实现数据结构中的单链表
#includeusing namespace std;//定义一个节点类class Node{public: int data; Node *next; Node():next(NULL){} Node(const int &value,Node *next_=NULL):data(value),next(next_){}};//定义一个单单链表class Linklis原创 2014-11-08 14:24:14 · 649 阅读 · 0 评论 -
删除链表中的重复接点
题目要求参考剑指offer面试题目57#includeusing namespace std;struct Node{ int data; Node *next; Node(int value):data(value),next(NULL){}};Node *create_link(){ Node *node1=new Node(1); Node *head=node1; N原创 2015-01-21 19:01:52 · 592 阅读 · 0 评论 -
简单插入排序
C++实现简单的插入排序原创 2014-10-29 21:05:59 · 585 阅读 · 0 评论 -
算法导论第二章C++实现归并排序
归并排序的思想算法导论里面讲的很详细的,,但数学原创 2014-10-30 11:14:29 · 436 阅读 · 0 评论 -
C++实现平衡二叉树
#include #include #include #define EQ(a,b) ((a)==(b))#define LT(a,b) ((a)<(b))#define LQ(a,b) ((a)>(b))#define LH +1 //左高#define EH 0 //等高#define RH -1 //右高#define maxSize 20#define maxWidth转载 2014-10-29 10:15:59 · 693 阅读 · 0 评论 -
C++实现简单插入排序
插入排序其实就像摆放扑克牌的位置一样#includeusing namespace std;//定义一个交换函数void swap(int &a,int &b){ int tmp; tmp=a; a=b; b=tmp;}void InsertSort(int *A,int length){ int i,j; for(int i=1;i<length;++i)原创 2014-10-29 15:46:03 · 511 阅读 · 0 评论 -
C++关于搜索二叉树的建立,查询,删除,求最大,最小元素
#includeusing namespace std;templateclass BTree;templateclass BNode{friend class BTree;public:BNode():left(NULL),right(NULL),patrent(NULL){}BNode(const Type &value):data(value),l原创 2014-10-22 21:41:25 · 822 阅读 · 1 评论 -
C++实现简单的选择排序
#includeusing namespace std;//定义一个交换函数void swap(int &a,int &b){ int tmp; tmp=a; a=b; b=tmp;}void bubblesort(int *A,int length){ int min; int i,j; for(int i=0;i<length-1;++i) { min=i原创 2014-10-29 15:31:26 · 439 阅读 · 0 评论 -
C++冒泡排序(3)
这是在之前冒泡排序(2)的原创 2014-10-29 15:17:49 · 385 阅读 · 0 评论 -
冒泡排序(1)
每次排序使得最小的一个元素在最上面原创 2014-10-29 14:58:30 · 407 阅读 · 0 评论 -
数据结构中用C++实现平衡二叉搜索树
#ifndef _AVL_H_#define _AVL_H_#include #define LH 1 //左高#define EH 0 //等高#define RH -1 //右高//平衡二叉排序树结点结构 template struct AVLNode{ ElemType data; //结点数据域 AVLNode *lchild;转载 2014-10-29 21:57:44 · 577 阅读 · 0 评论 -
算法导论第二章C++实现归并算法排序
算法导论第二章归并排序算法的C++实现原创 2014-10-30 11:55:33 · 630 阅读 · 0 评论 -
递归求解字符串长度
/*#includeusing namespace std;int mystrlen(char *buf,int N){ if(buf[0]==0||N==0) return 0; else if(N==1) return 1; int t=mystrlen(buf,N/2); if(t<N/2) return t; else return (t+mystrlen(原创 2014-10-29 21:04:58 · 438 阅读 · 0 评论 -
剑指offer面试题目63(二叉搜索树的第k个结点)
二叉搜索树的第K个接点,其中包含了二叉搜索树的创建,寻找其后继;最小节点等,,若干关于二叉搜索树的操作#include#includeusing namespace std;struct Node{ int data; Node *left; Node *right; Node *parent; Node(int value):data(value),left(NULL原创 2015-01-23 11:05:41 · 1152 阅读 · 0 评论