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

  • 大小: 49KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-06
  • 語言: C/C++
  • 標(biāo)簽:

資源簡(jiǎn)介

通訊錄管理系統(tǒng)使用c++編程語言編寫,其中文檔中包含源碼和設(shè)計(jì)報(bào)告 使用順序表作為存儲(chǔ)結(jié)構(gòu),折半查找,遞增排序。 具體的請(qǐng)參考我的csdn博客

資源截圖

代碼片段和文件信息

#include
#include
#include
#include
using?namespace?std;

/*??person類
包含人的姓名,城市,電話
*/
class?Person?
{
private:
string?name;
string?city;
string?phone;
public:?
Person(){}
Person(string?name?string?city?string?phone)?
{
this->name?=?name;
this->city?=?city;
this->phone?=?phone;
}
string?getCity()?
{
return?this->city;
}
void?setCity(string?city)?
{
this->city?=?city;
}
string?getPhone()?
{
return?this->phone;
}
void?setPhone(string?phone)
{
this->phone?=?phone;
}
string?getName()?
{
return?this->name;
}
void?setName(string?name)?
{
this->name?=?name;
}
void?update(string?name?string?city?string?phone)
{
this->name?=?name;
this->city?=?city;
this->phone?=?phone;
}
};


typedef?Person?ElemType;
typedef?int?Status;
const?int?SUCCESS?=?1;
const?int?ERROR?=?-2;

//定義節(jié)點(diǎn)類型
typedef?struct?DulNode
{
ElemType?data[100];
int?length;
}DulNode;

//排序
void?nodeSort(DulNode?&listint?localstring?oldNamestring?newName)
{
int?low?=?0;
int?high?=?0;
int?mid?=?0;
int?temp?=?0;
if(newName.compare(oldName)?<=?0)
{
low?=?0;
high?=?local?-?1;
temp?=?1; //向左查找
}else
{
low?=?local?+?1;
high?=?list.length-1;
temp?=?0; //向右查找
}
while(low?<=?high)
{
mid?=?(low?+?high)?/?2;
if(newName.compare(list.data[mid].getName())? {
high?=?mid?-?1;
}else
{
low?=?mid?+?1;
}
}
Person?tempPerson?=?list.data[local];
if(temp?==?1) //向右移動(dòng)
{
for(int?j?=?local?-?1?;j?>=?high?+?1;--j)
{
list.data[j?+?1]?=?list.data[j];
}
list.data[(high?+?1)]?=?tempPerson;
}else
{
for(int?j?=?local?+?1?;j?<=?high;?j++)
{
list.data[j?-?1]?=?list.data[j];
}
list.data[(high)]?=?tempPerson;
}
}

//插入節(jié)點(diǎn)折半插入
Status?nodeInsert(DulNode?&list?Person?person)?
{
int?len?=?list.length-1;
if(len?>=?0)
{
int?low?=?0;?int?high?=?len;
int?mid?=?0;
while(low?<=?high)
{
mid?=?(low?+?high)?/?2;
if(person.getName().compare(list.data[mid].getName())? {
high?=?mid?-?1;
}else
{
low?=?mid?+?1;
}
}
for(int?j?=?len;j?>=?high?+?1;--j)
{
list.data[j?+?1]?=?list.data[j];
}
list.data[(high?+?1)]?=?person;
}
else
{
list.data[0]?=?person;
}
list.length++;
return?SUCCESS;
}

//刪除節(jié)點(diǎn)?
Status?nodeDelete(DulNode?&list?string?name)?
{
if(list.length?>?0)
{
int?low?=?0;
int?high?=?list.length-1;
int?mid?=?(low?+?high)?/?2;
while(low?<=?high)
{
mid?=?(low?+?high)?/?2;
if(name.compare(list.data[mid].getName())? {
high?=?mid?-?1;
}else?if(name.compare(list.data[mid].getName())?>?0)
{
low?=?mid?+?1;
}
else
{
for(int?i?=?mid?+?1;i?<=?list.length?-?1;i?++)
{
list.data[i?-?1]?=?list.data[i];
}
list.length?--;
return?SUCCESS;
}
}
return?ERROR;
}

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????51690??2014-10-30?17:32??數(shù)據(jù)庫(kù)課程設(shè)計(jì)\數(shù)據(jù)結(jié)構(gòu)實(shí)習(xí)報(bào)告.docx

?????文件???????9699??2014-10-30?17:32??數(shù)據(jù)庫(kù)課程設(shè)計(jì)\源程序.cpp

?????文件????????287??2014-11-03?20:18??數(shù)據(jù)庫(kù)課程設(shè)計(jì)\題目要求.txt

?????目錄??????????0??2014-11-03?20:14??數(shù)據(jù)庫(kù)課程設(shè)計(jì)

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

????????????????61676????????????????????4


評(píng)論

共有 條評(píng)論

相關(guān)資源