-
Notifications
You must be signed in to change notification settings - Fork 0
Count the frequency of words in a file using a hash table #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MinyazevR
wants to merge
21
commits into
main
Choose a base branch
from
FrequencyOfOccurrenceOfWords
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
fa4fefe
a list has been written to implement a hash table
MinyazevR 4b98d8b
removed unnecessary code
MinyazevR f5f3c42
writing basic functions for working with a hash table
MinyazevR 823c97c
writing basic functions for working with a hash table
MinyazevR e20f209
Merge pull request #63 from MinyazevR/NewSinglyLinkedList
MinyazevR c2ecc54
the basic functions for working with a hash table are written
MinyazevR 03c083f
work has been done with the file
MinyazevR 6f63967
added a function to count the number of duplicate elements
MinyazevR 3900609
Merge pull request #64 from MinyazevR/NewSinglyLinkedList
MinyazevR dd937c5
Added comments
MinyazevR 9d9c881
Merge branch 'HashTable' of https://github.com/MinyazevR/Homework-1-s…
MinyazevR b8c7f28
Added comments
MinyazevR 8224d00
changed the function to expand the size of the array
MinyazevR 6e4416d
commit
MinyazevR 339d6b9
Merge branch 'HashTable' of https://github.com/MinyazevR/Homework-1-s…
MinyazevR bb3dc4d
trying to write a function to add an element
MinyazevR eeb8fd4
changing the functions for working with the list
MinyazevR 48247b9
changing functions to work with a hash table
MinyazevR 63cb7e2
changing functions to work with a hash table
MinyazevR 1ed2ace
changing the shortcomings in the functions for the hash table
MinyazevR 5d5eb34
changed the function for expanding the hash table
MinyazevR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
Homework № 9/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 16 | ||
| VisualStudioVersion = 16.0.31410.357 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FrequencyOfOccurrenceOfWords", "FrequencyOfOccurrenceOfWords\FrequencyOfOccurrenceOfWords.vcxproj", "{ECBF2784-C770-44C8-A208-31046468F94E}" | ||
| 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 | ||
| {ECBF2784-C770-44C8-A208-31046468F94E}.Debug|x64.ActiveCfg = Debug|x64 | ||
| {ECBF2784-C770-44C8-A208-31046468F94E}.Debug|x64.Build.0 = Debug|x64 | ||
| {ECBF2784-C770-44C8-A208-31046468F94E}.Debug|x86.ActiveCfg = Debug|Win32 | ||
| {ECBF2784-C770-44C8-A208-31046468F94E}.Debug|x86.Build.0 = Debug|Win32 | ||
| {ECBF2784-C770-44C8-A208-31046468F94E}.Release|x64.ActiveCfg = Release|x64 | ||
| {ECBF2784-C770-44C8-A208-31046468F94E}.Release|x64.Build.0 = Release|x64 | ||
| {ECBF2784-C770-44C8-A208-31046468F94E}.Release|x86.ActiveCfg = Release|Win32 | ||
| {ECBF2784-C770-44C8-A208-31046468F94E}.Release|x86.Build.0 = Release|Win32 | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {DD9F0B46-CB0B-4502-8346-C982FBFEB6C1} | ||
| EndGlobalSection | ||
| EndGlobal |
28 changes: 28 additions & 0 deletions
28
.../FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #include "ReadFile.h" | ||
| #include "TestReadFileUsingHashTable.h" | ||
| #include <stdio.h> | ||
|
|
||
| int main() | ||
| { | ||
| if (!testReadFileUsingHashTable()) | ||
| { | ||
| return -1; | ||
| } | ||
| Error error = NOT_ERROR; | ||
| HashTable* table = createTable(&error, 1); | ||
| int result = readFile(&table, "Text.txt"); | ||
| if (result == -1) | ||
| { | ||
| deleteHashTable(table); | ||
| printf("File not found"); | ||
| return -1; | ||
| } | ||
| if (error == INSUFFICIENT_MEMORY) | ||
| { | ||
| deleteHashTable(table); | ||
| printf("Memory not allocated"); | ||
| return -1; | ||
| } | ||
| printValue(table); | ||
| deleteHashTable(table); | ||
| } |
157 changes: 157 additions & 0 deletions
157
...encyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords.vcxproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| <?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>{ecbf2784-c770-44c8-a208-31046468f94e}</ProjectGuid> | ||
| <RootNamespace>FrequencyOfOccurrenceOfWords</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>v142</PlatformToolset> | ||
| <CharacterSet>Unicode</CharacterSet> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <UseDebugLibraries>false</UseDebugLibraries> | ||
| <PlatformToolset>v142</PlatformToolset> | ||
| <WholeProgramOptimization>true</WholeProgramOptimization> | ||
| <CharacterSet>Unicode</CharacterSet> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <UseDebugLibraries>true</UseDebugLibraries> | ||
| <PlatformToolset>v142</PlatformToolset> | ||
| <CharacterSet>Unicode</CharacterSet> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
| <ConfigurationType>Application</ConfigurationType> | ||
| <UseDebugLibraries>false</UseDebugLibraries> | ||
| <PlatformToolset>v142</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)'=='Release|Win32'"> | ||
| <LinkIncremental>false</LinkIncremental> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
| <LinkIncremental>true</LinkIncremental> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
| <LinkIncremental>false</LinkIncremental> | ||
| </PropertyGroup> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
| <ClCompile> | ||
| <WarningLevel>Level3</WarningLevel> | ||
| <SDLCheck>true</SDLCheck> | ||
| <ConformanceMode>true</ConformanceMode> | ||
| <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| </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;_CRT_SECURE_NO_WARNINGS;%(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> | ||
| <ClCompile Include="..\..\HashTable\HashTable\HashTable.c" /> | ||
| <ClCompile Include="..\..\SinglyLinkedListForHashTable\SinglyLinkedListForHashTable\SinglyLinkedListForHashTable.c" /> | ||
| <ClCompile Include="ReadFile.c" /> | ||
| <ClCompile Include="FrequencyOfOccurrenceOfWords.c" /> | ||
| <ClCompile Include="TestReadFileUsingHashTable.c" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ClInclude Include="..\..\HashTable\HashTable\HashTable.h" /> | ||
| <ClInclude Include="..\..\SinglyLinkedListForHashTable\SinglyLinkedListForHashTable\SinglyLinkedListForHashTable.h" /> | ||
| <ClInclude Include="ReadFile.h" /> | ||
| <ClInclude Include="TestReadFileUsingHashTable.h" /> | ||
| </ItemGroup> | ||
| <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
| <ImportGroup Label="ExtensionTargets"> | ||
| </ImportGroup> | ||
| </Project> |
48 changes: 48 additions & 0 deletions
48
...currenceOfWords/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords.vcxproj.filters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <?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="ReadFile.c"> | ||
| <Filter>Исходные файлы</Filter> | ||
| </ClCompile> | ||
| <ClCompile Include="..\..\HashTable\HashTable\HashTable.c"> | ||
| <Filter>Исходные файлы</Filter> | ||
| </ClCompile> | ||
| <ClCompile Include="..\..\SinglyLinkedListForHashTable\SinglyLinkedListForHashTable\SinglyLinkedListForHashTable.c"> | ||
| <Filter>Исходные файлы</Filter> | ||
| </ClCompile> | ||
| <ClCompile Include="FrequencyOfOccurrenceOfWords.c"> | ||
| <Filter>Исходные файлы</Filter> | ||
| </ClCompile> | ||
| <ClCompile Include="TestReadFileUsingHashTable.c"> | ||
| <Filter>Исходные файлы</Filter> | ||
| </ClCompile> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ClInclude Include="..\..\HashTable\HashTable\HashTable.h"> | ||
| <Filter>Файлы заголовков</Filter> | ||
| </ClInclude> | ||
| <ClInclude Include="..\..\SinglyLinkedListForHashTable\SinglyLinkedListForHashTable\SinglyLinkedListForHashTable.h"> | ||
| <Filter>Файлы заголовков</Filter> | ||
| </ClInclude> | ||
| <ClInclude Include="ReadFile.h"> | ||
| <Filter>Файлы заголовков</Filter> | ||
| </ClInclude> | ||
| <ClInclude Include="TestReadFileUsingHashTable.h"> | ||
| <Filter>Файлы заголовков</Filter> | ||
| </ClInclude> | ||
| </ItemGroup> | ||
| </Project> |
27 changes: 27 additions & 0 deletions
27
Homework № 9/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords/ReadFile.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #include <stdio.h> | ||
| #include "ReadFile.h" | ||
|
|
||
| int readFile(HashTable** table, const char* fileName) | ||
| { | ||
| FILE* file = fopen(fileName, "r"); | ||
| if (file == NULL) | ||
| { | ||
| return -1; | ||
| } | ||
| while (!feof(file)) | ||
| { | ||
| // words in the file are less than 100 characters in size | ||
| char array[100] = { '\0' }; | ||
| Error error = NOT_ERROR; | ||
| if (fscanf(file, "%s", array) != EOF) | ||
| { | ||
| addElement(array, table, &error); | ||
| if (error == INSUFFICIENT_MEMORY) | ||
| { | ||
| return -2; | ||
| } | ||
| } | ||
| } | ||
| fclose(file); | ||
| return 0; | ||
| } | ||
5 changes: 5 additions & 0 deletions
5
Homework № 9/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords/ReadFile.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #pragma once | ||
| #include "../../HashTable/HashTable/HashTable.h" | ||
|
|
||
| // Function for reading a file | ||
| int readFile(HashTable** table, const char* fileName); |
1 change: 1 addition & 0 deletions
1
Homework № 9/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords/Test.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Hello World S Hello Hello S World Test Commit A S |
28 changes: 28 additions & 0 deletions
28
... 9/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords/TestReadFileUsingHashTable.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #include "TestReadFileUsingHashTable.h" | ||
| #include "ReadFile.h" | ||
|
|
||
| bool testReadFileUsingHashTable() | ||
| { | ||
| Error error = NOT_ERROR; | ||
| HashTable* table = createTable(&error, 100); | ||
| int result = readFile(&table, "Test.txt"); | ||
| if (result == -1) | ||
| { | ||
| deleteHashTable(table); | ||
| return false; | ||
| } | ||
| if (error == INSUFFICIENT_MEMORY) | ||
| { | ||
| deleteHashTable(table); | ||
| return false; | ||
| } | ||
| const int firstCheck = countNumberOfDuplicateItemsForSpecificList("Hello", table); | ||
| const int secondCheck = countNumberOfDuplicateItemsForSpecificList("World", table); | ||
| const int thirdCheck = countNumberOfDuplicateItemsForSpecificList("Test", table); | ||
| const int fourthCheck = countNumberOfDuplicateItemsForSpecificList("Commit", table); | ||
| const int fifthCheck = countNumberOfDuplicateItemsForSpecificList("A", table); | ||
| const int sixthCheck = countNumberOfDuplicateItemsForSpecificList("S", table); | ||
| deleteHashTable(table); | ||
| return firstCheck == 3 && secondCheck == 2 && thirdCheck == 1 | ||
| && fourthCheck == 1 && fifthCheck == 1 && sixthCheck == 3; | ||
| } |
5 changes: 5 additions & 0 deletions
5
... 9/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords/TestReadFileUsingHashTable.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #pragma once | ||
| #include <stdbool.h> | ||
|
|
||
| // Function for checking the counting of words in the text | ||
| bool testReadFileUsingHashTable(); |
1 change: 1 addition & 0 deletions
1
Homework № 9/FrequencyOfOccurrenceOfWords/FrequencyOfOccurrenceOfWords/Text.txt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 16 | ||
| VisualStudioVersion = 16.0.31410.357 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HashTable", "HashTable\HashTable.vcxproj", "{7F515015-3F19-4A2A-9F71-2B4E17988297}" | ||
| 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 | ||
| {7F515015-3F19-4A2A-9F71-2B4E17988297}.Debug|x64.ActiveCfg = Debug|x64 | ||
| {7F515015-3F19-4A2A-9F71-2B4E17988297}.Debug|x64.Build.0 = Debug|x64 | ||
| {7F515015-3F19-4A2A-9F71-2B4E17988297}.Debug|x86.ActiveCfg = Debug|Win32 | ||
| {7F515015-3F19-4A2A-9F71-2B4E17988297}.Debug|x86.Build.0 = Debug|Win32 | ||
| {7F515015-3F19-4A2A-9F71-2B4E17988297}.Release|x64.ActiveCfg = Release|x64 | ||
| {7F515015-3F19-4A2A-9F71-2B4E17988297}.Release|x64.Build.0 = Release|x64 | ||
| {7F515015-3F19-4A2A-9F71-2B4E17988297}.Release|x86.ActiveCfg = Release|Win32 | ||
| {7F515015-3F19-4A2A-9F71-2B4E17988297}.Release|x86.Build.0 = Release|Win32 | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {4E72E434-3C39-4E83-A4CF-8341EC15AAA4} | ||
| EndGlobalSection | ||
| EndGlobal |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.