![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 67
isohoman
好好学习,天天向上
展开
-
3 双链表
// 0408a.cpp//双链表#include "stdafx.h"int main(int argc, char* argv[]){ Person data1={1,"li","shuxue"}; Person data2={2,"wang","hanyu"}; Person data3={3,"zheng","computer"}; void *pPos1,*pPos原创 2012-12-06 20:41:42 · 308 阅读 · 0 评论 -
环链表
// 0408b.cpp //环链表 #include "stdafx.h"struct Node{ int data; Node *pNext;};bool IsRing(Node *pHead)//判断是否是环链表{ Node *pFlow,*pFast; pFlow=pFast=pHead; while(pFast&&pFast->pNext) { pF原创 2012-12-06 20:43:33 · 283 阅读 · 0 评论 -
1 单向链表
//单向链表 赋值和动态分配内存#include "stdafx.h"#include struct Node{ int iData; struct Node *pNext;};void Func(struct Node * pHead){ int i=1; while(pHead) { pHead->iData=i++; pHead=pHead->pNext原创 2012-12-06 19:20:17 · 398 阅读 · 0 评论 -
选择排序/快速排序
//#include "stdafx.h"#include void Swap(int &num1,int &num2){ int temp=num1; num1=num2; num2=temp;}void SelectSort(int nums[],int count){ int i,j,k; for(i=0; i<count-1; i++){ k=i;//初始原创 2012-12-06 20:58:53 · 268 阅读 · 0 评论 -
2 双向链表 PushBack/PopFront
//实现调用和功能实现分开 双向链表#include "stdafx.h"void BuildData(){ Person data; while(1){ scanf("%d %s %s",&data.iId, data.szName,data.szMajor); if(data.iId<1) break; PushBack(&data); }}void原创 2012-12-06 19:52:58 · 936 阅读 · 0 评论 -
使用递归遍与历释放二叉数
// 使用递归遍与历释放二叉数#include "stdafx.h"#include #include struct Node{ int data; Node *pLeft; Node *pRight;};void InsertTree(Node *&pRoot,int data){ if(pRoot == NULL){ pRoot=(Node *)malloc(原创 2012-12-06 20:50:07 · 314 阅读 · 0 评论