91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

請參考算法導論第三版英文版Introduction to Algorithms 3rd Edition,本程序為第10章到第14章常用數據結構的c/c++實現。 IDE環境為vc++ 6.0。 主要包括: 隊列 雙向鏈表 哈希表 二叉搜索樹

資源截圖

代碼片段和文件信息

#include?“stdafx.h“
#include?“binSearchTree.h“
#include?“queue.h“
#include?
#include?
using?namespace?std;

void?BinSearchTree::insert(TreeNode?*x)//節點插入
{
TreeNode?*targetRoot=rootNode;
TreeNode?*parentRoot=NULL;
int?flags=-1;
while(targetRoot?!=?NULL)
{
parentRoot?=?targetRoot;
if?(targetRoot->key?key)
{
targetRoot?=?targetRoot->rightChild;
flags=0;
}?
else
{
targetRoot?=?targetRoot->leftChild;
flags=1;
}
}
if?(flags==-1)
{
rootNode?=?x;
}?
else?if(flags?==?0)
{
parentRoot->rightChild?=?x;
}
else?if?(flags?==?1)
{
parentRoot->leftChild?=?x;
}?
else
{
cout<<“error?during?inserting“< }

x->parent?=?parentRoot;
x->leftChild?=?x->rightChild?=?NULL;
elementsNum++;

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????249??2012-02-09?19:49??DataStructures\binSearchTree.asp

?????文件???????5629??2012-02-13?19:36??DataStructures\binSearchTree.cpp

?????文件????????894??2012-02-11?10:28??DataStructures\binSearchTree.h

?????文件????????328??2012-02-11?13:59??DataStructures\DataStructures.cpp

?????文件???????5250??2012-02-09?19:49??DataStructures\DataStructures.dsp

?????文件????????553??2012-02-01?13:47??DataStructures\DataStructures.dsw

?????文件??????99328??2012-02-13?19:38??DataStructures\DataStructures.ncb

?????文件?????361472??2012-02-13?19:38??DataStructures\DataStructures.opt

?????文件???????2665??2012-02-13?19:38??DataStructures\DataStructures.plg

?????文件???????1219??2012-02-13?19:37??DataStructures\hash.cpp

?????文件????????545??2012-02-09?11:06??DataStructures\hash.h

?????文件????????878??2012-02-09?11:22??DataStructures\list.cpp

?????文件????????720??2012-02-09?11:00??DataStructures\list.h

?????文件????????977??2012-02-13?19:31??DataStructures\queue.cpp

?????文件????????295??2012-02-13?19:31??DataStructures\queue.h

?????文件???????1256??2012-02-01?13:47??DataStructures\ReadMe.txt

?????文件????????301??2012-02-01?13:47??DataStructures\StdAfx.cpp

?????文件????????769??2012-02-01?13:47??DataStructures\StdAfx.h

?????文件???????4295??2012-02-11?13:54??DataStructures\test.cpp

?????文件????????110??2012-02-09?20:19??DataStructures\test.h

?????目錄??????????0??2012-02-13?19:38??DataStructures

-----------?---------??----------?-----??----

???????????????487733????????????????????21


評論

共有 條評論