Compare commits

..

23 Commits

Author SHA1 Message Date
596d863a25 #1 Added operator overload, [], to Linked List 2022-11-23 20:44:21 +00:00
ee0556730d #1 Added count method to Linked List 2022-11-22 21:28:04 +00:00
15c4684857 #1 Added find function to Linked List 2022-11-22 20:53:37 +00:00
84645fad5f #1 Added remove method to Linked List 2022-11-22 20:21:59 +00:00
954ea3f949 #1 Removed tail property from Linked List 2022-11-21 14:23:39 +00:00
e338ddb255 #1 Updated insert method on Linked List to work with index 0 2022-11-21 14:18:34 +00:00
7cabc13196 Moved datastructures into src directory and added insert method into Linked List #1 2022-11-21 13:47:55 +00:00
32a5a1c51a #1 Moved datastructures directly into src directory and added insert method to linked list 2022-11-21 13:41:51 +00:00
700d6696c8 Updated Linked List to look at head instead of count 2022-11-15 07:42:33 +00:00
23e7860e43 Updated Linked List to use adapated protection levels 2022-11-15 07:31:41 +00:00
25091543a2 Updated Generic Nodes to have public properties 2022-11-15 07:29:37 +00:00
05d637acb5 Updated Linked List - Added append function (Doesn't have access to Node member variables) 2022-11-13 14:34:00 +00:00
462d1ccc83 Updated Linked List to have constructors 2022-11-13 13:10:21 +00:00
7a75d22514 Updated Linked List to inherit generic constructors.
Not sure how the create method will integrate. Might integrate it into the linked list class so that it can just append it straight into the relevant node.
2022-11-13 00:20:10 +00:00
e76f3b452e Updated protection modifiers on generic nodes. 2022-11-13 00:06:58 +00:00
96d5eb8071 Moved all function definitions into header files as required for templated classes/functions 2022-11-12 23:34:32 +00:00
5913fb8084 Updated Linked List Node to work with shared pointers 2022-11-07 14:14:49 +00:00
2da0705577 Updated Generic nodes to incorporate smart pointers 2022-11-07 14:08:53 +00:00
deb58f03bb Added Create method to Linked List Node 2022-11-07 14:00:04 +00:00
9ec4e515f2 Created Linked List node + Linked List - Incomplete 2022-11-07 13:38:27 +00:00
227614c62d Updated Visual Studio project files 2022-11-07 11:47:13 +00:00
4c21f99291 Created Generic nodes - requires confirmation 2022-11-07 11:45:19 +00:00
dba577e099 Created VS Project 2022-11-07 10:51:27 +00:00
10 changed files with 588 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>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{b126f459-712b-4505-89b8-ef02d606d964}</ProjectGuid>
<RootNamespace>DataStructures</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>StaticLibrary</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>
<ItemGroup>
<ClInclude Include="src\Generic\directednode.h" />
<ClInclude Include="src\Generic\undirectednode.h" />
<ClInclude Include="src\LinkedList\linkedlist.h" />
<ClInclude Include="src\LinkedList\linkedlistnode.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<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="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<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>
<ClInclude Include="src\Generic\directednode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Generic\undirectednode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\LinkedList\linkedlist.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\LinkedList\linkedlistnode.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,26 @@
#pragma once
#include <memory>
namespace Generic {
template <typename T, typename NodeType>
class DirectedNode
{
public:
DirectedNode(T value, std::shared_ptr<NodeType> left = nullptr, std::shared_ptr<NodeType> right = nullptr);
~DirectedNode();
T value;
std::shared_ptr<NodeType> left;
std::shared_ptr<NodeType> right;
protected:
};
template <typename T, typename NodeType>
DirectedNode<T, NodeType>::DirectedNode(T value, std::shared_ptr<NodeType> left, std::shared_ptr<NodeType> right) {
this->value = value;
this->left = left;
this->right = right;
}
template <typename T, typename NodeType>
DirectedNode<T, NodeType>::~DirectedNode() {}
}

View File

@ -0,0 +1,23 @@
#pragma once
#include <memory>
namespace Generic {
template <typename T, typename NodeType>
class UndirectedNode
{
public:
UndirectedNode(T value, std::shared_ptr<NodeType> next = nullptr);
~UndirectedNode();
T value;
std::shared_ptr<NodeType> next;
};
template <typename T, typename NodeType>
UndirectedNode<T, NodeType>::UndirectedNode(T value, std::shared_ptr<NodeType> next) {
this->value = value;
this->next = next;
}
template <typename T, typename NodeType>
UndirectedNode<T, NodeType>::~UndirectedNode() {}
}

View File

@ -0,0 +1,15 @@
#pragma once
#include "../Generic/undirectednode.h"
namespace Datastructures {
namespace Nodes {
template <typename T>
class LinkedListNode : public Generic::UndirectedNode<T, LinkedListNode<T>>
{
public:
//Inherit Constructor and destructor from generic Undirectetd Node
using Generic::UndirectedNode<T, LinkedListNode<T>>::UndirectedNode;
private:
};
}
}

View File

@ -0,0 +1,142 @@
#pragma once
#include "Nodes/linkedlistnode.h"
namespace Datastructures {
template <typename T>
class LinkedList
{
public:
LinkedList();
LinkedList(T value);
~LinkedList();
T& operator[](int index);
void append(T value);
bool insert(T value, int index);
bool remove(int index);
int count() const;
int find(const T &value) const;
enum EFindResult {
eNotFound = -1,
};
private:
std::shared_ptr<Nodes::LinkedListNode<T>> getIndex(int index);
std::shared_ptr<Nodes::LinkedListNode<T>> mHead;
int mCount;
};
//Generic Class constructor for the Linked List
template <typename T>
LinkedList<T>::LinkedList() {
mCount = 0;
mHead = nullptr;
}
//Class constructor for the Linked List, taking a preset value to go into the head of the list
template <typename T>
LinkedList<T>::LinkedList(T value) {
mCount = 1;
mHead = std::make_shared<Nodes::LinkedListNode<T>>(value);
}
template <typename T>
LinkedList<T>::~LinkedList() {}
template <typename T>
T& LinkedList<T>::operator[](int index) {
//Return the value from a given index. (Will return null pointer if out of range)
return this->getIndex(index)->value;
}
template <typename T>
void LinkedList<T>::append(T value) {
mCount++;
if (mHead == nullptr) {
mHead = std::make_shared<Nodes::LinkedListNode<T>>(value);
return;
}
//Add new node (Count already altered so we need to look a node before the end)
std::shared_ptr<Nodes::LinkedListNode<T>> node = this->getIndex(mCount - 2);
node->next = std::make_shared<Nodes::LinkedListNode<T>>(value);
}
template <typename T>
bool LinkedList<T>::insert(T value, int index) {
if (index == 0 || this->mCount == 0)
{//If the new item needs to go into the head of the linked list.
mHead = std::make_shared<Nodes::LinkedListNode<T>>(value, mHead);
}
else
{
//Get the node before the one we are going to be inserting
std::shared_ptr<Nodes::LinkedListNode<T>> node = this->getIndex(index-1);
//If node is nullptr, index is out of range
if (node == nullptr)
return false;
node->next = std::make_shared<Nodes::LinkedListNode<T>>(value, node->next);
}
//Append the new value into a new node.
mCount++;
return true;
}
template <typename T>
bool LinkedList<T>::remove(int index) {
//If the list is empty
if (this->mCount == 0)
return false;
//Check if we are looking to remove the head node (0)
if (index == 0)
{
this->mHead = this->mHead->next;
}
else
{
//Get the node before the one that is about to be removed
std::shared_ptr<Nodes::LinkedListNode<T>> node = this->getIndex(index - 1);
//Point this node to the node pointed to by the one about to be removed
node->next = node->next->next;
}
//Reduce the total count of nodes
mCount--;
return true;
}
template <typename T>
int LinkedList<T>::count() const {
return this->mCount;
}
template <typename T>
int LinkedList<T>::find(const T& value) const {
//Start at the head of the list
std::shared_ptr<Nodes::LinkedListNode<T>> node = mHead;
for (int i = 0; i < this->mCount; i++)
{//Loop through list to try and find value
if (node->value == value)
return i;
node = node->next;
}
return EFindResult::eNotFound; //-1
}
template <typename T>
std::shared_ptr<Nodes::LinkedListNode<T>> LinkedList<T>::getIndex(int index) {
//Check if the value lies within the range of the list.
if (index < 0 || index >= this->mCount)
return nullptr;
std::shared_ptr<Nodes::LinkedListNode<T>> node = mHead;
for (int i = 0; i < index; i++)
{//Interate through the linked list i times to get to the index.
node = node->next;
}
return node;
}
}

41
DataStructuresCPP.sln Normal file
View File

@ -0,0 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DataStructuresCPP", "DataStructuresCPP.vcxproj", "{B338A154-A64D-4ADA-A276-E12076AC9A15}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DataStructures", "DataStructures\DataStructures.vcxproj", "{B126F459-712B-4505-89B8-EF02D606D964}"
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
{B338A154-A64D-4ADA-A276-E12076AC9A15}.Debug|x64.ActiveCfg = Debug|x64
{B338A154-A64D-4ADA-A276-E12076AC9A15}.Debug|x64.Build.0 = Debug|x64
{B338A154-A64D-4ADA-A276-E12076AC9A15}.Debug|x86.ActiveCfg = Debug|Win32
{B338A154-A64D-4ADA-A276-E12076AC9A15}.Debug|x86.Build.0 = Debug|Win32
{B338A154-A64D-4ADA-A276-E12076AC9A15}.Release|x64.ActiveCfg = Release|x64
{B338A154-A64D-4ADA-A276-E12076AC9A15}.Release|x64.Build.0 = Release|x64
{B338A154-A64D-4ADA-A276-E12076AC9A15}.Release|x86.ActiveCfg = Release|Win32
{B338A154-A64D-4ADA-A276-E12076AC9A15}.Release|x86.Build.0 = Release|Win32
{B126F459-712B-4505-89B8-EF02D606D964}.Debug|x64.ActiveCfg = Debug|x64
{B126F459-712B-4505-89B8-EF02D606D964}.Debug|x64.Build.0 = Debug|x64
{B126F459-712B-4505-89B8-EF02D606D964}.Debug|x86.ActiveCfg = Debug|Win32
{B126F459-712B-4505-89B8-EF02D606D964}.Debug|x86.Build.0 = Debug|Win32
{B126F459-712B-4505-89B8-EF02D606D964}.Release|x64.ActiveCfg = Release|x64
{B126F459-712B-4505-89B8-EF02D606D964}.Release|x64.Build.0 = Release|x64
{B126F459-712B-4505-89B8-EF02D606D964}.Release|x86.ActiveCfg = Release|Win32
{B126F459-712B-4505-89B8-EF02D606D964}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8602429F-B7C8-4C07-94D2-8DD415A716D8}
EndGlobalSection
EndGlobal

136
DataStructuresCPP.vcxproj Normal file
View File

@ -0,0 +1,136 @@
<?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>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{b338a154-a64d-4ada-a276-e12076ac9a15}</ProjectGuid>
<RootNamespace>DataStructuresCPP</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>
<AdditionalIncludeDirectories>$(SolutionDir)DataStructures\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</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>
<ItemGroup>
<ClCompile Include="src\main.cpp" />
</ItemGroup>
<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="Source Files">
<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="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<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="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

14
src/main.cpp Normal file
View File

@ -0,0 +1,14 @@
#include <iostream>
#include <linkedlist.h>
int main() {
Datastructures::LinkedList<int> list;
list.append(5);
list.append(200);
list.insert(20, 2);
std::cout << list.count() << std::endl; //3
std::cout << list[0] << list[1] << list[2] << std::endl; //520020
list.remove(0);
int x = list.find(10);
std::cout << list.count() << std::endl; //2
}