This commit is contained in:
2024-03-04 23:45:56 +08:00
commit 2e9a13a76c
33 changed files with 4563 additions and 0 deletions

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="SqList.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="SqList.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{15e9e8ad-d18e-45b2-861a-699717de99bb}</ProjectGuid>
<RootNamespace>My21SqList</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="SqList.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="SqList.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,156 @@
// 2-1-SqList-顺序表
#include <iostream>//cout,cin
using namespace std;
#include "SqList.h"
char pause;
void dispmenu() {
//显示主菜单
cout << endl;
cout << "*** 顺 序 表 ***\n";
cout << " 1-初始化顺序表\n";
cout << " 2-创建顺序表\n";
cout << " 3-获取第i个元素\n";
cout << " 4-按值查找元素位序\n";
cout << " 5-插入第i个元素\n";
cout << " 6-删除第i个元素\n";
cout << " 7-修改第i个元素\n";
cout << " 8-清空表\n";
cout << " 9-测表长\n";
cout << " 10-测表空\n";
cout << " 11-测表满\n";
cout << " 12-显示表\n";
cout << " 13-按值查找前驱\n";
cout << " 0-退出\n";
}
//主函数
void main() {
int i;
int e, pre_e;
SqList<int> L; //建立容量为20、元素类型为整型的空顺序表
system("cls"); //执行系统命令cls清屏
int choice;
do {
dispmenu(); //显示主菜单
cout << "Enter choice(1~120 退出):";
cin >> choice;
switch (choice) {
case 1: //初始化线性表
cout << "请输入要创建的顺序表的长度:";
cin >> i;
cout << endl;
InitList(L, i);
cout << endl << "创建成功!" << endl;
break;
case 2: //创建线性表
cout << "请输入要创建的元素个数:";
cin >> i;
cout << endl;
CreateList(L, i);
cout << "创建的顺序表元素为:\n"; //显示表元素
DispList(L);
cout << endl;
break;
case 3: //获取第i个元素
cout << "请输入元素序号:";
cin >> i;
cout << endl;
if (GetElem_i(L, i, e))
cout << endl << "" << i << "个元素为:" << e << endl;
else
cout << endl << "元素不存在!" << endl;
break;
case 4: //按值查找
cout << "请输入要查询的元素值:";
cin >> e;
i = LocateElem_e(L, e);
if (i)
cout << endl << e << "是第" << i << "个数据元素" << endl;
else
cout << endl << "不存在此元素!" << endl;
break;
case 5: // 在第i个位置插入元素
cout << "输入插入位置:" << endl;
cin >> i;
cout << "输入插入元素值:" << endl;
cin >> e;
if (InsertElem_i(L, i, e)) {
cout << endl << "插入成功!" << endl;
DispList(L);
}
else
cout << endl << "插入不成功!" << endl;;
break;
case 6: //删除第i个元素
cout << "输入删除元素位置:" << endl;
cin >> i;
if (DeleElem_i(L, i)) {
cout << endl << "删除成功!" << endl;
DispList(L);
}
else
cout << endl << "删除失败!" << endl;
break;
case 7: //修改第i个元素的值
cout << "输入修改元素位置:" << endl;
cin >> i;
cout << "输入新元素值:" << endl;
cin >> e;
if (PutElem(L, i, e)) {
cout << endl << "修改成功!" << endl;
DispList(L);
}
else
cout << endl << "修改失败!" << endl;
break;
case 8: // 清空表
ClearList(L);
break;
case 9: // 测表长
cout << "表长为:" << ListLength(L) << endl;
break;
case 10: //测表空
if (ListEmpty(L))
cout << endl << "空表!" << endl;
else
cout << endl << "不是空表!" << endl;
break;
case 11: // 未表满
if (ListFull(L))
cout << endl << "表满!" << endl;
else
cout << endl << "表不满!" << endl;
break;
case 12: //遍历显示表
DispList(L);
cout << endl;
cin.get(pause);
system("pause");
break;
case 13:
cout << "测试顺序表为\n";
DispList(L);
cout << "输入查找前驱的元素值:\n";
cin >> e;
if (PriorElem_e(L, e, pre_e))
cout << e << "的前驱元素为:" << pre_e << endl;
else
cout << e << "无前驱元素!" << endl;
break;
case 0: //退出
cout << "结束运行bye-bye!" << endl;
break;
default: //无效选择
cout << "无效选择!\n";
break;
}
} while (choice != 0);
}//end of main function

View File

@@ -0,0 +1,175 @@
template <class DT>
struct SqList // 顺序表
{
DT* elem; // 表首址
int length; // 表长
int size; // 表容量
};
//算法2.1
template <class DT>
bool PriorElem_e(SqList<DT> L, DT e, DT& pre_e) // 求值为e的元素前驱
{
int k;
k = LocateElem_e(L, e); //
if (k > 1)
{
GetElem_i(L, k - 1, pre_e);
return false;
}
else
return true;
}
//【算法2.2】 初始化
template <class DT>
bool InitList(SqList<DT>& L, int m)
{
L.elem = new DT[m]; // 申请表空间
if (L.elem == NULL)
{
cout << "未创建成功!"; // 申请不成功,退出
exit(1);
}
L.length = 0; // 申请成功属性赋值。空表表长为0
L.size = m; // 表容量为m
return true;
}
//【算法2.3】 创建表元素
template <class DT>
bool CreateList(SqList<DT>& L, int n)
{
int i;
if (n > L.size) // 1.元素个数大于表容量,不能创建。
{
cout << "元素个数大于表长,不能创建!" << endl;
return false;
}
cout << "请依次输入" << n << "个元素值:" << endl; // 2.依位序输入各元素值
for (i = 1; i <= n; i++)
cin >> L.elem[i - 1];
L.length = n; // 3.表长为创建的元素个数
return true;
}
//【算法2.4】 销毁顺序表
template <class DT>
void DestroyList(SqList<DT>& L)
{
delete[] L.elem; // 1.释放表空间
L.length = 0; // 2.属性赋值
L.size = 0;
}
//【算法2.5】 获取第i个元素值
template<class DT>
bool GetElem_i(SqList<DT> L, int i, DT& e)
{
if (i<1 || i>L.length) // 1.位序不合理返回false
{
cout << "该元素不存在!" << endl;
return false;
}
e = L.elem[i - 1]; // 2. 否则获取第i个元素值
return true; // 返回true
}
//【算法2.6】 按值查找
template<class DT>
int LocateElem_e(SqList<DT> L, DT e)
{
for (int i = 0; i < L.length; i++) // 顺序查找
if (L.elem[i] == e) // 1.找到
return i + 1; // 返回元素位序
return 0; // 2.未找到返回0
}
//【算法2.7】
template<class DT>
bool InsertElem_i(SqList<DT>& L, int i, DT e)
{
if (L.length >= L.size) // 1.表满,不能插入
return false;
if (i<1 || i>L.length + 1) // 2.插入位置不合理,不能插入
return false;
for (int j = L.length; j >= i; j--) // 3. an~ai依次后移
L.elem[j] = L.elem[j - 1];
L.elem[i - 1] = e;
L.length++;
return true; // 插入成功返回true
}
//【算法2.8】 删除第i个元素
template<class DT>
bool DeleElem_i(SqList<DT>& L, int i)
{
if (L.length == 0) // 1.表空,不能删除
return false;
if (i<1 || i>L.length) // 2.删除位置不合理,不能插入
return false;
for (int j = i; j < L.length; j++) // 3. ai+1~an依次前移
L.elem[j - 1] = L.elem[j];
L.length--;
return true; // 删除成功返回true
}
//【算法2.9】
template<class DT>
bool PutElem(SqList<DT>& L, int i, DT e) // 修改第i个元素的值
{
if (i<1 || i>L.length) // 1.位序不合理,不能修改,
return false; // 返回false
L.elem[i - 1] = e; // 2.重置第i个元素值
return true; // 3.修改成功返回true
}
// 清空顺序表
template<class DT>
void ClearList(SqList<DT>& L)
{
L.length = 0; // 空表表长为0
}
// 测表长
template<class DT>
int ListLength(SqList<DT> L)
{
return L.length;
}
template<class DT>
bool ListEmpty(SqList<DT> L) // 测表空
{
if (L.length == 0) // 空表返回true
return true;
else
return false; // 非空表返回false
}
template<class DT>
bool ListFull(SqList<DT> L)
{
if (L.length == L.size) // 表满返回true
return true;
else
return false; // 表不满返回false
}
//【算法2.10】 遍历输出
template <class DT>
void DispList(SqList<DT> L)
{
int i;
for (i = 0; i < L.length; i++) // 依位序输出元素值
{
cout << L.elem[i] << "\t";
}
cout << endl;
}

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="LinkList.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="LinkList.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{631ed17d-100b-4089-8ae8-768fb5d19442}</ProjectGuid>
<RootNamespace>My22LinkList</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="LinkList.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="LinkList.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,188 @@
// 2-2-LinkList-单链表
// WARNING: /sdl is disabled to pass the compilation process.
#include<iostream> //cout,cin
using namespace std;
#include "LinkList.h"
//算法2.25 单链表逆置
void ReverseLinkList(LNode<int>*& L)
{
LNode<int>* p, * q; // 1.设置工作指针
p = L->next; // 原链表头结点,作为逆置后表的头结点
L->next = NULL;
while (p) // 2. 依次摘除原链表结点,以头插法插入到逆置链表中
{
q = p; // 2.1 q取当前结点位置
p = p->next; // 2.2 p指向下一个待处理结点
q->next = L->next; // 2.3 将q 插入到头结点之后
L->next = q;
}
}
void dispmenu()
{ // 显示主菜单
cout << endl;
cout << " *** 单 链 表 ***\n";
cout << " 1-初始化单链表\n";
cout << " 2-尾插法顺序表\n";
cout << " 3-头插法建表\n";
cout << " 4-获取第i个元素\n";
cout << " 5-按值查找\n";
cout << " 6-插入第i个元素\n";
cout << " 7-删除第i个元素\n";
cout << " 8-修改第i个元素\n";
cout << " 9-清空表\n";
cout << "10-测表长\n";
cout << "11-测表空\n";
cout << "12-遍历输出\n";
cout << "13-按值查找前驱\n";
cout << "14-单链表逆置\n";
cout << "0-退出\n";
}
char pause;
// 主函数
int main()
{
int i, n;
int e, pre_e;
LNode<int>* L;
system("cls"); // 清屏
int choice;
do
{
dispmenu(); // 显示主菜单
cout << "Enter choice(1~120 退出):";
cin >> choice;
switch (choice)
{
case 1: // 初始化单链表
InitList(L);
cout << endl << "创建成功!" << endl;
break;
case 2: // 尾插法建单链表
cout << "尾插法创建单链表" << endl;
cout << "输入要创建的顺序表中元素个数:";
cin >> n;
cout << endl;
CreateList_1(L, n);
cout << "创建的单链表为:";
DispList(L);
cout << endl;
break;
case 3: // 头插法创建单链表
cout << "头插法创建单链表" << endl;
cout << "输入要创建的顺序表中元素个数:";
cin >> n;
cout << endl;
CreateList_2(L, n);
cout << "创建的单链表为:";
DispList(L);
cout << endl;
break;
case 4: // 获取第i个元素
cout << "请输入元素序号:";
cin >> i;
cout << endl;
if (GetElem_i(L, i, e))
cout << endl << "" << i << "个元素为:" << e << endl;
else
cout << endl << "元素不存在!" << endl;
break;
case 5: // 查询元素位序
cout << "请输入要查询的元素值:";
cin >> e;
i = LocateElem_e(L, e);
if (i)
cout << endl << e << "是第" << i << "个数据元素" << endl;
else
cout << endl << "不存在此元素!" << endl;
break;
case 6: // 插入第i个元素
cout << "输入插入位置:" << endl;
cin >> i;
cout << "输入插入元素值:" << endl;
cin >> e;
if (InsertElem_i(L, i, e))
{
cout << endl << "插入成功!" << endl;
cout << "插入元素后的单链表为:" << endl;
DispList(L);
}
else
cout << endl << "插入不成功!" << endl;
break;
case 7: // 删除第i个元素
cout << "输入删除元素位置:" << endl;
cin >> i;
if (DeleElem_i(L, i))
{
cout << endl << "删除成功!" << endl;
cout << "删除元素后的单链表为:" << endl;
DispList(L);
}
else
cout << endl << "删除失败!" << endl;
break;
case 8: // 修改第i个元素
cout << "输入修改元素位置:" << endl;
cin >> i;
cout << "输入新元素值:" << endl;
cin >> e;
if (PutElem_i(L, i, e))
{
cout << endl << "修改成功!" << endl;
cout << "修改后的单链表为:" << endl;
DispList(L);
}
else
cout << endl << "修改失败!" << endl;
break;
case 9: // 清空表
ClearList(L);
break;
case 10: // 测表长
cout << "表长为:" << ListLength(L) << endl;
break;
case 11: // 测表空
if (ListEmpty(L))
cout << endl << "空表!" << endl;
else
cout << endl << "不是空表!" << endl;
break;
case 12: //遍历显示表
DispList(L);
cout << endl;
break;
case 13:
cout << "测试链表为\n";
DispList(L);
cout << "输入查找前驱的元素值:\n";
cin >> e;
if (PriorElem_e(L, e, pre_e))
cout << e << "的前驱元素为:" << pre_e << endl;
else
cout << e << "无前驱元素!" << endl;
break;
case 14: // 逆置单链表
cout << "逆置前的单链表为:";
DispList(L);
ReverseLinkList(L);
cout << "逆置后的单链表为:";
DispList(L);
cout << endl;
break;
case 0: //退出,销毁链表
DestroyList(L);
cout << "结束运行bye-bye!" << endl;
break;
default: //无效选择
cout << "无效选择!\n";
break;
}
} while (choice != 0);
return 0;
}//end of main function

View File

@@ -0,0 +1,253 @@
template <class DT>
struct LNode //链表结点
{
DT data; //数据域,存储数据元素值
LNode* next; //指针域,指向下一个结点
};
//算法2.1
template <class DT>
bool PriorElem_e(LNode<DT>* L, DT e, DT& pre_e) // 求值为e的元素前驱
{
int k;
k = LocateElem_e(L, e); // 1.获取e的位序k
if (k > 1) // 2.位序k大于1
{
GetElem_i(L, k - 1, pre_e); // 第k-1个元素为e的前驱
return true;
}
else // 3.元素e无前驱
return false; // 返回false
}
//【算法2.14】 创建空单链表
template <class DT>
bool InitList(LNode<DT>*& L)
{
L = new LNode<DT>; // 1.创建头结点
if (!L) exit(1); // 2.创建失败,退出
L->next = NULL; // 3.创建成功
return true; // 返回true
}
//【算法2.15】 尾插法创建n的元素
template <class DT>
bool CreateList_1(LNode<DT>*& L, int n)
{
int i;
LNode<DT>* p, * s;
p = L; //1.工作指针初始化,指向尾结点
cout << "依次输入" << n << "个数据元素:" << endl;
for (i = 1; i <= n; i++) // 2.按元素位序正序创建各结点
{
s = new LNode<DT>; // 2.1 新建一个结点s
if (!s) // 2.2 创建失败返回false
return false;
cin >> s->data; // 2.3 输入结点值
s->next = p->next; // 2.4 s 链在表尾
p->next = s;
p = s; // 2.5 工作指针指向 s
}
return true; // 3.创建成功返回true
}
//【算法2.16】 头插法创建n个元素
template <class DT>
bool CreateList_2(LNode<DT>* (&L), int n)
{
int i;
LNode<DT>* s;
cout << "逆序输入" << n << "个数据元素:" << endl;
for (i = 1; i <= n; i++) // 1.按元素位序逆序创建各结点
{
s = new LNode<DT>; // 1.1 新建一个结点 s
if (!s) // 1.2 创建失败返回false
return false;
cin >> s->data; // 1.3 输入结点值
s->next = L->next; // 1.4 s 在头结点后
L->next = s;
}
return true; // 1.创建成功返回true
}
//【算法2.17】
template <class DT>
void DestroyList(LNode<DT>* (&L)) // 释放链表所占空间
{
LNode<DT>* p;
while (L) // 1. 表非空,从头结点开始,依次释放结点
{
p = L; // 1.1 处理表头结点
L = L->next; // 1.2 头指针后移
delete p; // 1.3 释放表头结点所占内存
}
L = NULL; // 2.头指针指向空
}
//【算法2.18】 获取第i个元素
template<class DT>
bool GetElem_i(LNode<DT>* L, int i, DT& e)
{
LNode<DT>* p; // 1.初始化
p = L->next; // 1.1 设置工作指针,从首结点开始数结点
int j = 1; // 1.2 计数器初始化
while (p && j < i) // 2.定位到第i个元素结点
{
p = p->next; j++;
}
if (!p || j > i) // 3 未找到返回false
return false;
else // 4. 找到
{
e = p->data; // 获取第i个元素值
return true; // 返回true
}
}
//【算法2.19】 查找值为e的元素位序
template<class DT>
int LocateElem_e(LNode<DT>* L, DT e)
{
LNode<DT>* p; // 1.初始化从首元开始查找
p = L->next; // 1.1从首元开始查找
int j = 1; // 1.2 计数器初值
while (p && p->data != e) // 2.顺序查找
{
p = p->next; // 2.1未找到指针后移
j++; // 2.2 计数器增1
}
if (p == NULL) // 3. 判断是否找到
return 0; // 3.1末找到返回0
else
return j; // 3.2 找到,返回位序
}
//【算法2.20】 插入第i个元素
template<class DT>
bool InsertElem_i(LNode<DT>*& L, int i, DT e)
{
int j = 0;
LNode<DT>* p; // 1.初始化
p = L; // 工作指针初始化
while (p && j < i - 1) // 2. 定位到插入点前驱
{
p = p->next;
j++;
}
if (!p || j > i - 1) // 3.判断定位是否成功:
return false; // 3.1 定位失败,不能插入
else // 3.2 定位成功
{
LNode<DT>* s;
s = new LNode<DT>; // 3.2.1建立新结点
s->data = e; // 3.2.2新结点赋值
s->next = p->next; // 3.2.3结点S链接到p结点之后
p->next = s;
return true; // 3.2.4 插入成功返回true
}
}
//【算法2.21】 删除第i个元素
template<class DT>
bool DeleElem_i(LNode<DT>* (&L), int i)
{
LNode<DT>* p, * q; //1.初始化:设置工作指针
p = L; //查找从头结点开始
int j = 0; //计数器初始化
while (p->next && j < i - 1) //2.p定位到删除点的前驱
{
p = p->next;
j++;
}
if (!p->next || j > i - 1) //3.删除位置不合理,不能删除
return false; //返回false
else //4.删除操作
{
q = p->next; //4.1暂存删除结点位置
p->next = q->next; //4.2从链表中摘除删除结点
delete q;
return true; //4.3删除成功返回true
}
}
//【算法2.22】 修改第i个元素值
template<class DT>
bool PutElem_i(LNode<DT>* (&L), int i, DT e)
{
LNode<DT>* p; // 1.初始化:设置工作指针
p = L->next; // 从首结点开始,数结点
int j = 1; // 计数器初始化
while (p && j < i) // 2.查找第i个元素结点
{
p = p->next; j++;
}
if (!p || j > i) // 3.元素不存在,返回false
return false;
else // 4.定位成功
{
p->data = e; // 修改元素值
return true; // 返回true
}
}
// 释放链表所占空间
template<class DT>
void ClearList(LNode<DT>* (&L))
{
LNode<DT>* p;
while (L->next) // 从首元结点开始,依次释放结点
{
p = L->next;
L->next = p->next;
delete p;
}
cout << endl << "表已清空!" << endl;
}
//【算法2.23】 测表长
template<class DT>
int ListLength(LNode<DT>* L)
{ // 1.初始化
int len = 0; // 1.1 结点计数器赋初值0
LNode<DT>* p; // 1.2设置工作指针
p = L; // 指向头结点
while (p->next) // 2.数结点个数。有后继结点,
{
len++; p = p->next; // 结点数增1指针后移
}
return len; // 3.返回表长
}
//
template<class DT>
bool ListEmpty(LNode<DT>* L) //测表空
{
if (L->next == NULL)
return true; //空表返回1
else
return false; //不空返回0
}
//【算法2.24】 遍历表
template <class DT>
void DispList(LNode<DT>* L) // 显示表内容
{
LNode<DT>* p; // 1. 设置工作指针
p = L; // 从首元结点开始遍历
while (p->next) // 2.依次输出各结点值
{
p = p->next; cout << p->data << "\t";
}
cout << endl;
}

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="SqListApp.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="SqList.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{6816c6c8-1b6d-4773-812a-e7a50324cb12}</ProjectGuid>
<RootNamespace>My23SqListApp</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="SqListApp.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="SqList.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,160 @@
template <class DT>
struct SqList //顺序表类
{
DT* elem; //表首址
int length; //表长
int size;//表容量
};
//【算法2.2】
template <class DT>
bool InitList(SqList<DT>& L, int m)
{//构建函数创建一表容量为m的空表
L.elem = new DT[m];// 申请表空间
if (L.elem == NULL)
{
cout << "未创建成功!";
exit(1);
}
L.length = 0; // 空表表长为0
L.size = m; //表容量为m
return true;
}
//【算法2.3】
template <class DT>
bool CreateList(SqList<DT>& L, int n) //创建表长度为n的顺序表
{
int i;
if (n > L.size)
{
cout << "元素个数大于表长,不能创建!" << endl;
return false;
}
cout << "请依次输入" << n << "个元素值:" << endl;
for (i = 1; i <= n; i++)
cin >> L.elem[i - 1];
L.length = n;
return true;
}
//【算法2.4】
template <class DT>
void DestroyList(SqList<DT>& L) //销毁顺序表,释放表空间
{
delete[] L.elem;
L.length = 0;
L.size = 0;
}
//【算法2.5】
template<class DT>
bool GetElem_i(SqList<DT> L, int i, DT& e)// 获取第i个元素值
{
if (i<0 || i>L.length)
return false;
e = L.elem[i - 1];
return true;
}
//【算法2.6】
template<class DT>
int LocateElem_e(SqList<DT> L, DT e) // 按值查找
{
int i;
for (i = 0; i < L.length; i++) // 顺序查找
if (L.elem[i] == e) // 找到
return i + 1;
return 0; // 未找到
}
//【算法2.7】
template<class DT>
bool InsertElem_i(SqList<DT>& L, int i, DT e) // 在第i个位置插入新元素
{
int j;
if (L.length >= L.size) //1.表满,不能插入
return false;
if (i<1 || i>L.length + 1) //2.插入位置不合理,不能插入
return false;
for (j = L.length; j >= i; j--) //3. an~ai依次后移
L.elem[j] = L.elem[j - 1];
L.elem[i - 1] = e;
L.length++;
return true; // 插入成功返回true
}
//【算法2.8】
template<class DT>
bool DeleElem_i(SqList<DT>& L, int i) // 删除第i个元素
{
int j;
if (L.length == 0) //1.表空,不能删除
return false;
if (i<1 || i>L.length) //2.删除位置不合理,不能插入
return false;
for (j = i; j < L.length; j++) //3. ai~an依次前移
L.elem[j - 1] = L.elem[j];
L.length--;
return true; // 删除成功返回true
}
//【算法2.9】
template<class DT>
bool PutElem(SqList<DT>& L, int i, DT e) // 修改第i个元素的值
{
if (i<1 || i>L.length) //1.位置不合理,不能修改
return false;
L.elem[i - 1] = e; //2.重置第i个元素值
return true; //3.修改成功返回true
}
//清空顺序表
template<class DT>
void ClearList(SqList<DT>& L)
{
L.length = 0;
}
//测表长
template<class DT>
int ListLength(SqList<DT> L)
{
return L.length;
}
//测表空
template<class DT>
bool ListEmpty(SqList<DT> L)
{
if (L.length == 0)
return true;
else
return false;
}
//测表满
template<class DT>
bool ListFull(SqList<DT> L)
{
if (L.length == L.size)
return true;
else
return false;
}
//【算法2.10】
template <class DT>
void DispList(SqList<DT> L) //遍历输出
{
int i;
for (i = 0; i < L.length; i++)
{
cout << L.elem[i] << "\t";
}
cout << endl;
}

View File

@@ -0,0 +1,188 @@
// 2-3-SqListApp-顺序表应用
#include<iostream>//cout,cin
using namespace std;
#include "SqList.h"
char pause;
void dispmenu()
{ // 显示主菜单
cout << "\n*** 顺序表的应用 ***\n";
cout << " 1-集合并A=AB\n";
cout << " 2-顺序表逆置\n";
cout << " 3-多项式求和\n";
cout << " 0-退出\n";
}
//算法2.11
template <class DT>
void Union(SqList<DT>& La, SqList<DT> Lb) // 求La=LaLa
{
DT e;
int k, i;
for (i = 1; i <= Lb.length; i++) // 扫描Lb
{
GetElem_i(Lb, i, e); // 1. 获取Lb的第i个元素
if (!LocateElem_e(La, e)) // 2.如果La中无此元素
{
k = La.length + 1; // 添加在La的表尾
InsertElem_i(La, k, e);
}
}
}
//算法2.12
template <class DT>
void ReverseSqList(SqList<DT>& L) // 顺序表元素逆置
{
DT t;
int i;
for (i = 0; i < L.length / 2; i++) // 2.L.elem[i]<-->L.elem[L.length-i-1]
{
t = L.elem[i];
L.elem[i] = L.elem[L.length - i - 1];
L.elem[L.length - i - 1] = t;
}
return;
}
//算法2.13 多项式求和 lc=la+lb
void PolyAdd(SqList<float> la, SqList<float> lb, SqList<float>& lc)
{
int i = 0; // 1.初始化,设置处理起始位置
while (i < la.length && i < lb.length) // 2.两个多项式均未处理完
{
lc.elem[i] = la.elem[i] + lb.elem[i]; // 相同位序上的系数相加
i++;
}
if (la.length > lb.length) // 3.la未处理完lb已处理完
{
while (i < la.length) // lc取la中剩余项
{
lc.elem[i] = la.elem[i];
i++;
}
}
else // 3.lb未处理完la已处理完
{
while (i < lb.length) // lc取lb中剩余项
{
lc.elem[i] = lb.elem[i];
i++;
}
}
}
//显示多顶式
void DispPoly(float A[], int n)
{
int i;
cout << A[0] << "+";
for (i = 1; i < n - 1; i++)
cout << A[i] << "x^" << i << " + ";
cout << A[i] << "x^" << i;
cout << endl;
}
//主函数
int main()
{
int e;
int na, nb, nc;
SqList<int> La, Lb; // 集合A、B
SqList<int> Lc; // 顺序表
SqList<float> fa, fb, fc; // 多项式A、B、C
system("cls"); // 清屏
int choice;
do
{
dispmenu(); // 显示主菜单
cout << "Enter choice(1~4,0退出):";
cin >> choice;
switch (choice)
{
case 1: // 求集合并
cout << "创建集合A、B\n";
cout << "输入集合A元素个数";
cin >> na;
cout << "输入集合B元素个数";
cin >> nb;
InitList(La, na + nb); // 创建集合A
cout << "创建集合A的元素\n";
CreateList(La, na);
InitList(Lb, nb); // 创建集合B
cout << "创建集合B的元素\n";
CreateList(Lb, nb);
cout << "集合A为" << endl; // 显示集合A
DispList(La);
cout << "集合B为" << endl; // 显示集合B
DispList(Lb);
Union(La, Lb); // 求集合并
cout << "AB为:" << endl; // 显示结果
DispList(La);
cout << endl;
DestroyList(La);
DestroyList(Lb);
break;
case 2: // 顺序表逆置
cout << "请输入要创建的顺序表中元素个数:";
cin >> nc;
InitList(Lc, nc);
cout << endl;
CreateList(Lc, nc);
cout << "创建的顺序表为:" << endl; // 显示集合A
DispList(Lc);
ReverseSqList(Lc);
cout << "逆置后的顺序表为:" << endl; // 显示集合A
DispList(Lc);
cout << endl;
DestroyList(Lc);
break;
case 3: //多项式求和
cout << "\n创建多项式A\n"; // 创建多项式A
cout << "输入多项式A的项数";
cin >> na;
InitList(fa, na);
cout << "按幂升序输入多项式A各项系数\n";
CreateList(fa, na);
cout << "\n创建多项式B\n"; // 创建多项式B
cout << "输入多项式B的项数";
cin >> nb;
InitList(fb, nb);
cout << "按幂升序输入多项式B各项系数\n";
CreateList(fb, nb);
cout << "\n多项式 A 为 " << endl; // 显示多项式A
DispPoly(fa.elem, na);
cout << "\n多项式 B 为 " << endl; // 显示多项式B
DispPoly(fb.elem, nb);
nc = (na >= nb) ? na : nb;
InitList(fc, nc); // 创建多项式C
PolyAdd(fa, fb, fc); // 求多项式 C=A+B
cout << "\n多项式A + 多项式B = " << endl; // 显示结果
DispPoly(fc.elem, nc);
cout << endl;
DestroyList(fa);
DestroyList(fb);
DestroyList(fc);
break;
case 0: // 退出
cout << " 结束运行bye-bye!" << endl;
break;
default: // 无效选择
cout << "无效选择!\n";
break;
}
} while (choice != 0);
return 0;
}//end of main function

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="PolyAdd.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{3bbbc9d3-2aea-48cc-abf7-908da7982a0b}</ProjectGuid>
<RootNamespace>My24PolyAdd</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="PolyAdd.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,241 @@
// 2-4-PolyAdd-稀疏多项式求和
// WARNING: /sdl is disabled to pass the compilation process.
#include<iostream>//cout,cin
using namespace std;
struct PolyNode // 多项式结点
{
float coef; // 系数
int exp; // 指数
PolyNode* next; // 指向下一项结点
};
void InitPoly(PolyNode*& L)
{ //创建一空多项式
L = new PolyNode;
L->next = NULL;
}
bool CreatePoly(PolyNode*& L, int n) // 尾插法创建n项多项式
{
int i;
PolyNode* p, * s;
p = L;
for (i = 1; i <= n; i++) // 按幂升序依次输入多项式各项系数与幂指数
{
s = new PolyNode;
if (!s)
return false;
cout << "输入第" << i << "项系数和幂指数:";
cin >> s->coef >> s->exp;
s->next = p->next;
p->next = s;
p = s;
}
return true;
}
//显示多顶式
void DispPoly(PolyNode* L) // 通过遍历结点,输出多项式
{
PolyNode* p;
if (!L) // 空表,返回
{
cout << "空表!";
return;
}
p = L->next;
while (p && p->next)
{
cout << p->coef << "x^" << p->exp << " + ";
p = p->next;
}
cout << p->coef << "x^" << p->exp;
cout << endl;
}
//【算法2.26】 求多项式LA=LA+LB
void PolyAdd(PolyNode*& LA, PolyNode*& LB)
{
float sum;
PolyNode* pa, * pb, * qa, * qb; // 1.工作指针初始化
pa = LA;
qa = pa->next;
pb = LB;
qb = pb->next;
while (qa != NULL && qb != NULL) // 2. 两表均不空
{
if (qa->exp < qb->exp) // 2.1 LA的幂小
{ // pa、qa后移
pa = qa; qa = qa->next;
}
else if (qa->exp > qb->exp) //2.2 LA 幂大
{
pb->next = qb->next; // qb链接到pa之后
qb->next = qa;
pa->next = qb;
pa = qb;
qb = pb->next;
}
else // 2.3 LA与LB幂相同
{
sum = qa->coef + qb->coef; // 计算系数和
if (sum != 0) // 2.3.1 系数和不为0
{
qa->coef = sum; // 2.3.1.1 qa->coef←sum
pa = qa; qa = qa->next; // 2.3.1.2 paqa后移
pb->next = qb->next;
delete qb; // 2.3.1.3删除qb
qb = pb->next;
}
else // 2.3.2 系数和为0
{
pa->next = qa->next;
delete qa; // 2.3.2.1 删除qa
qa = pa->next; // 2.3.2.2 qa为pa后继
pb->next = qb->next;
delete qb; // 2.3.2.3 删除qb
qb = pb->next; // 2.3.2.4 qb为pb的后继
}
}
}//while
if (qb != NULL) // 3. LA处理结束LB未结束
pa->next = qb; // 3.1 qb链到qa之后
delete pb; // 3.2 删除lb头结点
LB = NULL;
}//Add
void DestroyPoly(PolyNode*& L) // 释放链表所占空间
{
PolyNode* p;
while (L) // 从头结点开始,依次释放结点
{
p = L;
L = L->next;
delete p;
}
L = NULL; // 头结点指向空
}
void SortPoly(PolyNode*& L) // 将多项式按幂升序排序
{
PolyNode* p1, * p2, * q, * r; // 采用插入排序算法
p1 = L; p2 = p1->next; // p1是p2的前驱
if (p2 == NULL || p2->next == NULL) // 空表或只有1项的多项式不需要排序
{
cout << "不需要排序!" << endl;
return;
}
r = L->next; // 有序表表尾
q = r->next; // q为当前处理项有序表的后一项
while (q) // 未处理完
{ // 从首元结点开始查找插入点
p1 = L; p2 = p1->next;
while (q->exp > p2->exp && p2 != q) // 当前结点幂大,插入点后移
{
p1 = p2; p2 = p2->next;
}
if (p2 == q) // 当前项无需移动
{
r = q; // 有序表表尾顺移
}
else // q插入到p2前面
{
r->next = q->next; // 摘除q结点
q->next = p1->next; // 在p1后插入结点q
p1->next = q;
}
q = r->next; // 下一个需处理的项
}
return;
}
void dispmenu()
{//显示主菜单
cout << endl;
cout << "*** 稀疏多项式求和 ***\n";
cout << "1-创建多项式A\n";
cout << "2-创建多项式B\n";
cout << "3-多项式求和A=A+B\n";
cout << "4-显示多项式\n";
cout << "0-退出\n";
}
//主函数
int main()
{
int m, n;
char c;
PolyNode* LA, * LB;
system("cls"); // 执行系统命令cls清屏
int choice;
do
{
dispmenu(); // 显示主菜单
cout << "Enter choice(1~4,0 退出):";
cin >> choice;
switch (choice)
{
case 1: // 创建多项式A
InitPoly(LA);
cout << "请输入多项式 A 的项数: ";
cin >> m;
CreatePoly(LA, m);
cout << "创建的多项式 A 为:" << endl;
DispPoly(LA);
SortPoly(LA);
cout << "排序后多项式 A 为:" << endl;
DispPoly(LA);
break;
case 2: // 创建多项式B
InitPoly(LB);
cout << "请输入多项式B的项数 ";
cin >> n;
CreatePoly(LB, n);
cout << "创建的多项式B为" << endl;
DispPoly(LB);
SortPoly(LB);
cout << "排序后多项式 B 为:" << endl;
DispPoly(LB);
break;
case 3: //多项式求和
cout << "A = ";
DispPoly(LA);
cout << "B = ";
DispPoly(LB);
PolyAdd(LA, LB); // 求多项式 LA=LA+LB
cout << "A + B = "; // 显示结果
DispPoly(LA);
cout << endl;
break;
case 4: // 显示多项式
cout << "选择要显示的多项式 A 或 B" << endl;
cin >> c;
if (c == 'A' || c == 'a')
DispPoly(LA);
else if (c == 'B' || c == 'b')
DispPoly(LB);
else
cout << "选择错误!" << endl;
break;
case 5: //退出
DestroyPoly(LA);
DestroyPoly(LB);
cout << "结束运行bye-bye!" << endl;
break;
default: //非法选择
cout << "非法选择!\n";
break;
}
} while (choice != 0);
return 0;
}//end of main function

61
Chapter2/Chapter2.sln Normal file
View File

@@ -0,0 +1,61 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34322.80
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2-1-SqList", "2-1-SqList\2-1-SqList.vcxproj", "{15E9E8AD-D18E-45B2-861A-699717DE99BB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2-2-LinkList", "2-2-LinkList\2-2-LinkList.vcxproj", "{631ED17D-100B-4089-8AE8-768FB5D19442}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2-3-SqListApp", "2-3-SqListApp\2-3-SqListApp.vcxproj", "{6816C6C8-1B6D-4773-812A-E7A50324CB12}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2-4-PolyAdd", "2-4-PolyAdd\2-4-PolyAdd.vcxproj", "{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{15E9E8AD-D18E-45B2-861A-699717DE99BB}.Debug|x64.ActiveCfg = Debug|x64
{15E9E8AD-D18E-45B2-861A-699717DE99BB}.Debug|x64.Build.0 = Debug|x64
{15E9E8AD-D18E-45B2-861A-699717DE99BB}.Debug|x86.ActiveCfg = Debug|Win32
{15E9E8AD-D18E-45B2-861A-699717DE99BB}.Debug|x86.Build.0 = Debug|Win32
{15E9E8AD-D18E-45B2-861A-699717DE99BB}.Release|x64.ActiveCfg = Release|x64
{15E9E8AD-D18E-45B2-861A-699717DE99BB}.Release|x64.Build.0 = Release|x64
{15E9E8AD-D18E-45B2-861A-699717DE99BB}.Release|x86.ActiveCfg = Release|Win32
{15E9E8AD-D18E-45B2-861A-699717DE99BB}.Release|x86.Build.0 = Release|Win32
{631ED17D-100B-4089-8AE8-768FB5D19442}.Debug|x64.ActiveCfg = Debug|x64
{631ED17D-100B-4089-8AE8-768FB5D19442}.Debug|x64.Build.0 = Debug|x64
{631ED17D-100B-4089-8AE8-768FB5D19442}.Debug|x86.ActiveCfg = Debug|Win32
{631ED17D-100B-4089-8AE8-768FB5D19442}.Debug|x86.Build.0 = Debug|Win32
{631ED17D-100B-4089-8AE8-768FB5D19442}.Release|x64.ActiveCfg = Release|x64
{631ED17D-100B-4089-8AE8-768FB5D19442}.Release|x64.Build.0 = Release|x64
{631ED17D-100B-4089-8AE8-768FB5D19442}.Release|x86.ActiveCfg = Release|Win32
{631ED17D-100B-4089-8AE8-768FB5D19442}.Release|x86.Build.0 = Release|Win32
{6816C6C8-1B6D-4773-812A-E7A50324CB12}.Debug|x64.ActiveCfg = Debug|x64
{6816C6C8-1B6D-4773-812A-E7A50324CB12}.Debug|x64.Build.0 = Debug|x64
{6816C6C8-1B6D-4773-812A-E7A50324CB12}.Debug|x86.ActiveCfg = Debug|Win32
{6816C6C8-1B6D-4773-812A-E7A50324CB12}.Debug|x86.Build.0 = Debug|Win32
{6816C6C8-1B6D-4773-812A-E7A50324CB12}.Release|x64.ActiveCfg = Release|x64
{6816C6C8-1B6D-4773-812A-E7A50324CB12}.Release|x64.Build.0 = Release|x64
{6816C6C8-1B6D-4773-812A-E7A50324CB12}.Release|x86.ActiveCfg = Release|Win32
{6816C6C8-1B6D-4773-812A-E7A50324CB12}.Release|x86.Build.0 = Release|Win32
{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}.Debug|x64.ActiveCfg = Debug|x64
{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}.Debug|x64.Build.0 = Debug|x64
{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}.Debug|x86.ActiveCfg = Debug|Win32
{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}.Debug|x86.Build.0 = Debug|Win32
{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}.Release|x64.ActiveCfg = Release|x64
{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}.Release|x64.Build.0 = Release|x64
{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}.Release|x86.ActiveCfg = Release|Win32
{3BBBC9D3-2AEA-48CC-ABF7-908DA7982A0B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DE77319E-CE24-481A-B0F4-8B3DEFA26F5A}
EndGlobalSection
EndGlobal