Skip to content

Commit

Permalink
PA7
Browse files Browse the repository at this point in the history
  • Loading branch information
poiley committed Apr 3, 2018
1 parent 04be3e7 commit 84c53aa
Show file tree
Hide file tree
Showing 79 changed files with 1,342 additions and 0 deletions.
Binary file added Lab10/.vs/Lab10/v14/.suo
Binary file not shown.
Binary file added Lab10/Debug/Lab10.exe
Binary file not shown.
Binary file added Lab10/Debug/Lab10.ilk
Binary file not shown.
Binary file added Lab10/Debug/Lab10.pdb
Binary file not shown.
Binary file added Lab10/Lab10.VC.db
Binary file not shown.
28 changes: 28 additions & 0 deletions Lab10/Lab10.sln
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lab10", "Lab10\Lab10.vcxproj", "{16D0D5B8-7480-4E0F-92F7-4255739A59D3}"
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
{16D0D5B8-7480-4E0F-92F7-4255739A59D3}.Debug|x64.ActiveCfg = Debug|x64
{16D0D5B8-7480-4E0F-92F7-4255739A59D3}.Debug|x64.Build.0 = Debug|x64
{16D0D5B8-7480-4E0F-92F7-4255739A59D3}.Debug|x86.ActiveCfg = Debug|Win32
{16D0D5B8-7480-4E0F-92F7-4255739A59D3}.Debug|x86.Build.0 = Debug|Win32
{16D0D5B8-7480-4E0F-92F7-4255739A59D3}.Release|x64.ActiveCfg = Release|x64
{16D0D5B8-7480-4E0F-92F7-4255739A59D3}.Release|x64.Build.0 = Release|x64
{16D0D5B8-7480-4E0F-92F7-4255739A59D3}.Release|x86.ActiveCfg = Release|Win32
{16D0D5B8-7480-4E0F-92F7-4255739A59D3}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions Lab10/Lab10/Debug/Lab10.log
@@ -0,0 +1,3 @@
 Main.cpp
Lab10.vcxproj -> c:\users\poile\documents\visual studio 2015\Projects\Lab10\Debug\Lab10.exe
Lab10.vcxproj -> c:\users\poile\documents\visual studio 2015\Projects\Lab10\Debug\Lab10.pdb (Full PDB)
Binary file added Lab10/Lab10/Debug/Lab10.tlog/CL.command.1.tlog
Binary file not shown.
Binary file added Lab10/Lab10/Debug/Lab10.tlog/CL.read.1.tlog
Binary file not shown.
Binary file added Lab10/Lab10/Debug/Lab10.tlog/CL.write.1.tlog
Binary file not shown.
2 changes: 2 additions & 0 deletions Lab10/Lab10/Debug/Lab10.tlog/Lab10.lastbuildstate
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
Debug|Win32|c:\users\poile\documents\visual studio 2015\Projects\Lab10\|
Binary file added Lab10/Lab10/Debug/Lab10.tlog/link.command.1.tlog
Binary file not shown.
Binary file added Lab10/Lab10/Debug/Lab10.tlog/link.read.1.tlog
Binary file not shown.
Binary file added Lab10/Lab10/Debug/Lab10.tlog/link.write.1.tlog
Binary file not shown.
Binary file added Lab10/Lab10/Debug/Main.obj
Binary file not shown.
Binary file added Lab10/Lab10/Debug/vc140.idb
Binary file not shown.
Binary file added Lab10/Lab10/Debug/vc140.pdb
Binary file not shown.
8 changes: 8 additions & 0 deletions Lab10/Lab10/Header.h
@@ -0,0 +1,8 @@
#pragma once

#include <iostream>

using std::cout;

void mergeSort(int arr[], int startIndex, int endIndex);
void merge(int arr[], int startIndex, int middleIndex, int endIndex);
153 changes: 153 additions & 0 deletions Lab10/Lab10/Lab10.vcxproj
@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" 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">
<ProjectGuid>{16D0D5B8-7480-4E0F-92F7-4255739A59D3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Lab10</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</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" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Header.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
27 changes: 27 additions & 0 deletions Lab10/Lab10/Lab10.vcxproj.filters
@@ -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="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;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;hm;inl;inc;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="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Header.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
56 changes: 56 additions & 0 deletions Lab10/Lab10/Main.cpp
@@ -0,0 +1,56 @@
#include "Header.h"

int main(void) {
int data[] = { 2, 4, 3, 6, 7, 5, 1, 9, 8 }, size = 9;
mergeSort(data, 0, size - 1);

for (int i = 0; i < size; i++)
cout << data[i] << " ";
}

void mergeSort(int arr[], int startIndex, int endIndex) {
if (startIndex < endIndex) {
int middleIndex = (startIndex + endIndex) / 2;

/*Sort first and second halves*/
mergeSort(arr, middleIndex + 1, endIndex);
mergeSort(arr, startIndex, middleIndex);

/*Merge*/
merge(arr, startIndex, middleIndex, endIndex);
}
}

void merge(int arr[], int startIndex, int middleIndex, int endIndex) {
int firstHalfLen = middleIndex - startIndex + 1;
int secondHalfLen = endIndex - middleIndex;

/*create temp arrays*/
int *firstHalf = new int [firstHalfLen],
*secondHalf = new int [secondHalfLen];

/*Copy data to temp arrays firstHalf[] and secondHalf[]*/
for (int i = 0; i < firstHalfLen; i++)
firstHalf[i] = arr[startIndex + i];

for (int i = 0; i < secondHalfLen; i++)
secondHalf[i] = arr[middleIndex + i + 1];

/*Initial indexes for subarrays*/
int i = 0, j = 0, k = startIndex;

/*Merge the temp arrays back into arr[startIndex..endIndex]*/
for (; i < firstHalfLen && j < secondHalfLen; k++)
if (firstHalf[i] <= secondHalf[j])
arr[k] = firstHalf[i++];
else
arr[k] = secondHalf[j++];

/*Copy the remaining elements of firstHalf[], if there are any*/
for (; i < firstHalfLen; i++, k++)
arr[k] = firstHalf[i];

/*Copy the remaining elements of secondHalf[], if there are any*/
for (; j < secondHalfLen; j++, k++)
arr[k] = secondHalf[j];
}
35 changes: 35 additions & 0 deletions Lab8/Lab8/BSTNode.h
Expand Up @@ -17,3 +17,38 @@ class BSTNode {

/**NON MEMBER FUNCTIONS**/
ostream &operator<<(ostream &lhs, BSTNode &rhs);


bool &operator==(Recipe r1, Reipe r2) {
int r1ISize = sizeof(r1.getIngredients())/sizeof(*r1.getIngredients());
int r1DSize = sizeof(r1.getDirections())/sizeof(*r1.getDirections());
int r2ISize = sizeof(r2.getIngredients())/sizeof(*r2.getIngredients());
int r2DSize = sizeof(r2.getDirections())/sizeof(*r2.getDirections());

if(r1.getName() == r2.getName &&
r1.getYield() == r2.getYield() &&
r1.getnumIngretients() == r2.getnumIngredients()) {
if(r1ISize != r2ISize)
return false;

if(r1DSize != R2Size)
return false;s

for(int i = 0; i < r1ISize; i++)
if (r1.getIngredients()[i] != r2.getIngredients()[i])
return false;

for(int i = 0; i < r2DSize; i++)
if (r1.getDirections()[i] != r2.getDirections()[i])
return false;
return true;

} else {
return false;
}
}

bool searchFor(Recipe *pCurr, Recipe search) {
if(pCurr == NULL) {
}
}
Binary file added Lab9/.vs/Lab9/v14/.suo
Binary file not shown.
Binary file added Lab9/Debug/Lab9.exe
Binary file not shown.
Binary file added Lab9/Debug/Lab9.ilk
Binary file not shown.
Binary file added Lab9/Debug/Lab9.pdb
Binary file not shown.
Binary file added Lab9/Lab9.VC.db
Binary file not shown.
28 changes: 28 additions & 0 deletions Lab9/Lab9.sln
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lab9", "Lab9\Lab9.vcxproj", "{2DA505A9-098F-4813-9EEF-07D472B1096C}"
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
{2DA505A9-098F-4813-9EEF-07D472B1096C}.Debug|x64.ActiveCfg = Debug|x64
{2DA505A9-098F-4813-9EEF-07D472B1096C}.Debug|x64.Build.0 = Debug|x64
{2DA505A9-098F-4813-9EEF-07D472B1096C}.Debug|x86.ActiveCfg = Debug|Win32
{2DA505A9-098F-4813-9EEF-07D472B1096C}.Debug|x86.Build.0 = Debug|Win32
{2DA505A9-098F-4813-9EEF-07D472B1096C}.Release|x64.ActiveCfg = Release|x64
{2DA505A9-098F-4813-9EEF-07D472B1096C}.Release|x64.Build.0 = Release|x64
{2DA505A9-098F-4813-9EEF-07D472B1096C}.Release|x86.ActiveCfg = Release|Win32
{2DA505A9-098F-4813-9EEF-07D472B1096C}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions Lab9/Lab9/Debug/Lab9.log
@@ -0,0 +1,4 @@
 main.cpp
c:\users\poile\documents\visual studio 2015\projects\lab9\lab9\main.cpp(24): warning C4018: '<': signed/unsigned mismatch
Lab9.vcxproj -> C:\Users\poile\documents\visual studio 2015\Projects\Lab9\Debug\Lab9.exe
Lab9.vcxproj -> C:\Users\poile\documents\visual studio 2015\Projects\Lab9\Debug\Lab9.pdb (Full PDB)
Binary file added Lab9/Lab9/Debug/Lab9.tlog/CL.command.1.tlog
Binary file not shown.
Binary file added Lab9/Lab9/Debug/Lab9.tlog/CL.read.1.tlog
Binary file not shown.
Binary file added Lab9/Lab9/Debug/Lab9.tlog/CL.write.1.tlog
Binary file not shown.
2 changes: 2 additions & 0 deletions Lab9/Lab9/Debug/Lab9.tlog/Lab9.lastbuildstate
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
Debug|Win32|C:\Users\poile\documents\visual studio 2015\Projects\Lab9\|
Binary file added Lab9/Lab9/Debug/Lab9.tlog/link.command.1.tlog
Binary file not shown.
Binary file added Lab9/Lab9/Debug/Lab9.tlog/link.read.1.tlog
Binary file not shown.
Binary file added Lab9/Lab9/Debug/Lab9.tlog/link.write.1.tlog
Binary file not shown.
Binary file added Lab9/Lab9/Debug/Review.obj
Binary file not shown.
Binary file added Lab9/Lab9/Debug/main.obj
Binary file not shown.
Binary file added Lab9/Lab9/Debug/vc140.idb
Binary file not shown.
Binary file added Lab9/Lab9/Debug/vc140.pdb
Binary file not shown.

0 comments on commit 84c53aa

Please sign in to comment.