From aafa565a668057733c0acae363097d77f7af757f Mon Sep 17 00:00:00 2001 From: elizaveta Date: Wed, 12 Jun 2024 23:29:22 +0400 Subject: [PATCH 1/3] djbhgg --- Huffman/Huffman.sln | 25 ++++ Huffman/Huffman/Form1.Designer.cs | 39 +++++ Huffman/Huffman/Form1.cs | 10 ++ Huffman/Huffman/Form1.resx | 120 +++++++++++++++ Huffman/Huffman/Huffman.csproj | 11 ++ Huffman/Huffman/Program.cs | 17 +++ HuffmanState/HuffmanState.sln | 31 ++++ HuffmanState/HuffmanState/HuffmanCoding.h | 0 HuffmanState/HuffmanState/HuffmanManager.h | 0 .../HuffmanState/HuffmanParameters.cpp | 0 HuffmanState/HuffmanState/HuffmanParameters.h | 0 HuffmanState/HuffmanState/HuffmanState.cpp | 20 +++ HuffmanState/HuffmanState/HuffmanState.h | 0 .../HuffmanState/HuffmanState.vcxproj | 135 +++++++++++++++++ .../HuffmanState/HuffmanState.vcxproj.filters | 22 +++ HuffmanState/HuffmanState/HuffmanStorage.cpp | 0 HuffmanState/HuffmanState/HuffmanStorage.h | 0 .../HuffmanState/HuffmanVisualizer.cpp | 0 HuffmanState/HuffmanState/HuffmanVisualizer.h | 0 HuffmanVisualization/HuffmanVisualization.sln | 25 ++++ .../HuffmanVisualization/App.config | 6 + .../HuffmanVisualization/Form1.Designer.cs | 39 +++++ .../HuffmanVisualization/Form1.cs | 20 +++ .../HuffmanVisualization/HuffmanNode.cs | 31 ++++ .../HuffmanVisualization/HuffmanParameters.cs | 18 +++ .../HuffmanVisualization/HuffmanState.cs | 20 +++ .../HuffmanStateStorage.cs | 61 ++++++++ .../HuffmanVisualization/HuffmanTree.cs | 67 +++++++++ .../HuffmanVisualization.csproj | 107 ++++++++++++++ .../HuffmanVisualization/HuffmanVisualizer.cs | 32 ++++ .../HuffmanVisualization/Program.cs | 22 +++ .../Properties/AssemblyInfo.cs | 36 +++++ .../Properties/Resources.Designer.cs | 71 +++++++++ .../Properties/Resources.resx | 117 +++++++++++++++ .../Properties/Settings.Designer.cs | 30 ++++ .../Properties/Settings.settings | 7 + Laba4aisd/Laba4aisd.sln | 51 +++++++ Laba4aisd/Laba4aisd/Laba4aisd.vcxproj | 132 +++++++++++++++++ Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters | 17 +++ Laba4aisd/zadanie11/zadanie11.cpp | 65 +++++++++ Laba4aisd/zadanie11/zadanie11.vcxproj | 135 +++++++++++++++++ Laba4aisd/zadanie11/zadanie11.vcxproj.filters | 22 +++ Laba4aisd/zadanie2/zadanie2.vcxproj | 138 ++++++++++++++++++ Laba4aisd/zadanie2/zadanie2.vcxproj.filters | 17 +++ Laba4aisd/zadanie22/zadanie22.cpp | 1 + Laba4aisd/zadanie22/zadanie22.vcxproj | 135 +++++++++++++++++ Laba4aisd/zadanie22/zadanie22.vcxproj.filters | 22 +++ Tank/Tank/Entities/EntityMachine.cs | 5 + Tank/Tank/FormTankCollection.Designer.cs | 16 +- Tank/Tank/FormTankCollection.cs | 7 +- labalaba3/labalaba3/zadanie1.cpp | 104 +++++-------- labalaba3/lll/zadanie2.cpp | 73 ++++----- labalaba3/llll/zadanie3.cpp | 81 ++++------ labalaba3/zad4/zad4.cpp | 20 +++ labalaba3/zad4/zad4.vcxproj | 135 +++++++++++++++++ labalaba3/zad4/zad4.vcxproj.filters | 22 +++ 56 files changed, 2153 insertions(+), 184 deletions(-) create mode 100644 Huffman/Huffman.sln create mode 100644 Huffman/Huffman/Form1.Designer.cs create mode 100644 Huffman/Huffman/Form1.cs create mode 100644 Huffman/Huffman/Form1.resx create mode 100644 Huffman/Huffman/Huffman.csproj create mode 100644 Huffman/Huffman/Program.cs create mode 100644 HuffmanState/HuffmanState.sln create mode 100644 HuffmanState/HuffmanState/HuffmanCoding.h create mode 100644 HuffmanState/HuffmanState/HuffmanManager.h create mode 100644 HuffmanState/HuffmanState/HuffmanParameters.cpp create mode 100644 HuffmanState/HuffmanState/HuffmanParameters.h create mode 100644 HuffmanState/HuffmanState/HuffmanState.cpp create mode 100644 HuffmanState/HuffmanState/HuffmanState.h create mode 100644 HuffmanState/HuffmanState/HuffmanState.vcxproj create mode 100644 HuffmanState/HuffmanState/HuffmanState.vcxproj.filters create mode 100644 HuffmanState/HuffmanState/HuffmanStorage.cpp create mode 100644 HuffmanState/HuffmanState/HuffmanStorage.h create mode 100644 HuffmanState/HuffmanState/HuffmanVisualizer.cpp create mode 100644 HuffmanState/HuffmanState/HuffmanVisualizer.h create mode 100644 HuffmanVisualization/HuffmanVisualization.sln create mode 100644 HuffmanVisualization/HuffmanVisualization/App.config create mode 100644 HuffmanVisualization/HuffmanVisualization/Form1.Designer.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/Form1.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanNode.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanParameters.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanState.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanStateStorage.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanTree.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanVisualization.csproj create mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanVisualizer.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/Program.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/AssemblyInfo.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/Resources.Designer.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/Resources.resx create mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/Settings.Designer.cs create mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/Settings.settings create mode 100644 Laba4aisd/Laba4aisd.sln create mode 100644 Laba4aisd/Laba4aisd/Laba4aisd.vcxproj create mode 100644 Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters create mode 100644 Laba4aisd/zadanie11/zadanie11.cpp create mode 100644 Laba4aisd/zadanie11/zadanie11.vcxproj create mode 100644 Laba4aisd/zadanie11/zadanie11.vcxproj.filters create mode 100644 Laba4aisd/zadanie2/zadanie2.vcxproj create mode 100644 Laba4aisd/zadanie2/zadanie2.vcxproj.filters create mode 100644 Laba4aisd/zadanie22/zadanie22.cpp create mode 100644 Laba4aisd/zadanie22/zadanie22.vcxproj create mode 100644 Laba4aisd/zadanie22/zadanie22.vcxproj.filters create mode 100644 labalaba3/zad4/zad4.cpp create mode 100644 labalaba3/zad4/zad4.vcxproj create mode 100644 labalaba3/zad4/zad4.vcxproj.filters diff --git a/Huffman/Huffman.sln b/Huffman/Huffman.sln new file mode 100644 index 0000000..fa966c2 --- /dev/null +++ b/Huffman/Huffman.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Huffman", "Huffman\Huffman.csproj", "{D460B444-2BA9-4EE5-85C1-4B186B729B07}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D460B444-2BA9-4EE5-85C1-4B186B729B07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D460B444-2BA9-4EE5-85C1-4B186B729B07}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D460B444-2BA9-4EE5-85C1-4B186B729B07}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D460B444-2BA9-4EE5-85C1-4B186B729B07}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {77D0B3F5-7E0E-4348-B895-3BF868174E5B} + EndGlobalSection +EndGlobal diff --git a/Huffman/Huffman/Form1.Designer.cs b/Huffman/Huffman/Form1.Designer.cs new file mode 100644 index 0000000..7dab7c1 --- /dev/null +++ b/Huffman/Huffman/Form1.Designer.cs @@ -0,0 +1,39 @@ +namespace Huffman +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} \ No newline at end of file diff --git a/Huffman/Huffman/Form1.cs b/Huffman/Huffman/Form1.cs new file mode 100644 index 0000000..55c06d0 --- /dev/null +++ b/Huffman/Huffman/Form1.cs @@ -0,0 +1,10 @@ +namespace Huffman +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Huffman/Huffman/Form1.resx b/Huffman/Huffman/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Huffman/Huffman/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Huffman/Huffman/Huffman.csproj b/Huffman/Huffman/Huffman.csproj new file mode 100644 index 0000000..b57c89e --- /dev/null +++ b/Huffman/Huffman/Huffman.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net6.0-windows + enable + true + enable + + + \ No newline at end of file diff --git a/Huffman/Huffman/Program.cs b/Huffman/Huffman/Program.cs new file mode 100644 index 0000000..c99272a --- /dev/null +++ b/Huffman/Huffman/Program.cs @@ -0,0 +1,17 @@ +namespace Huffman +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } + } +} \ No newline at end of file diff --git a/HuffmanState/HuffmanState.sln b/HuffmanState/HuffmanState.sln new file mode 100644 index 0000000..f243be2 --- /dev/null +++ b/HuffmanState/HuffmanState.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HuffmanState", "HuffmanState\HuffmanState.vcxproj", "{D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}" +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 + {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Debug|x64.ActiveCfg = Debug|x64 + {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Debug|x64.Build.0 = Debug|x64 + {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Debug|x86.ActiveCfg = Debug|Win32 + {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Debug|x86.Build.0 = Debug|Win32 + {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Release|x64.ActiveCfg = Release|x64 + {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Release|x64.Build.0 = Release|x64 + {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Release|x86.ActiveCfg = Release|Win32 + {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {230F865B-1C2E-47B2-B59C-E8D81365476C} + EndGlobalSection +EndGlobal diff --git a/HuffmanState/HuffmanState/HuffmanCoding.h b/HuffmanState/HuffmanState/HuffmanCoding.h new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanState/HuffmanState/HuffmanManager.h b/HuffmanState/HuffmanState/HuffmanManager.h new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanState/HuffmanState/HuffmanParameters.cpp b/HuffmanState/HuffmanState/HuffmanParameters.cpp new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanState/HuffmanState/HuffmanParameters.h b/HuffmanState/HuffmanState/HuffmanParameters.h new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanState/HuffmanState/HuffmanState.cpp b/HuffmanState/HuffmanState/HuffmanState.cpp new file mode 100644 index 0000000..8e03ddb --- /dev/null +++ b/HuffmanState/HuffmanState/HuffmanState.cpp @@ -0,0 +1,20 @@ +// HuffmanState.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. +// + +#include + +int main() +{ + std::cout << "Hello World!\n"; +} + +// Запуск программы: CTRL+F5 или меню "Отладка" > "Запуск без отладки" +// Отладка программы: F5 или меню "Отладка" > "Запустить отладку" + +// Советы по началу работы +// 1. В окне обозревателя решений можно добавлять файлы и управлять ими. +// 2. В окне Team Explorer можно подключиться к системе управления версиями. +// 3. В окне "Выходные данные" можно просматривать выходные данные сборки и другие сообщения. +// 4. В окне "Список ошибок" можно просматривать ошибки. +// 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. +// 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. diff --git a/HuffmanState/HuffmanState/HuffmanState.h b/HuffmanState/HuffmanState/HuffmanState.h new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanState/HuffmanState/HuffmanState.vcxproj b/HuffmanState/HuffmanState/HuffmanState.vcxproj new file mode 100644 index 0000000..e768375 --- /dev/null +++ b/HuffmanState/HuffmanState/HuffmanState.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {d0284c25-617e-4e28-bcf4-c9c4d6ed25d4} + HuffmanState + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/HuffmanState/HuffmanState/HuffmanState.vcxproj.filters b/HuffmanState/HuffmanState/HuffmanState.vcxproj.filters new file mode 100644 index 0000000..56ba9db --- /dev/null +++ b/HuffmanState/HuffmanState/HuffmanState.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/HuffmanState/HuffmanState/HuffmanStorage.cpp b/HuffmanState/HuffmanState/HuffmanStorage.cpp new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanState/HuffmanState/HuffmanStorage.h b/HuffmanState/HuffmanState/HuffmanStorage.h new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanState/HuffmanState/HuffmanVisualizer.cpp b/HuffmanState/HuffmanState/HuffmanVisualizer.cpp new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanState/HuffmanState/HuffmanVisualizer.h b/HuffmanState/HuffmanState/HuffmanVisualizer.h new file mode 100644 index 0000000..e69de29 diff --git a/HuffmanVisualization/HuffmanVisualization.sln b/HuffmanVisualization/HuffmanVisualization.sln new file mode 100644 index 0000000..fd8e9a0 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuffmanVisualization", "HuffmanVisualization\HuffmanVisualization.csproj", "{BF0D5CA6-F7A2-4240-A727-AEF59108D94E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BF0D5CA6-F7A2-4240-A727-AEF59108D94E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF0D5CA6-F7A2-4240-A727-AEF59108D94E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF0D5CA6-F7A2-4240-A727-AEF59108D94E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF0D5CA6-F7A2-4240-A727-AEF59108D94E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {335046B9-A8A6-4ACF-A7BC-22D6FD6ADF8B} + EndGlobalSection +EndGlobal diff --git a/HuffmanVisualization/HuffmanVisualization/App.config b/HuffmanVisualization/HuffmanVisualization/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/HuffmanVisualization/HuffmanVisualization/Form1.Designer.cs b/HuffmanVisualization/HuffmanVisualization/Form1.Designer.cs new file mode 100644 index 0000000..f293371 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/Form1.Designer.cs @@ -0,0 +1,39 @@ +namespace HuffmanVisualization +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} \ No newline at end of file diff --git a/HuffmanVisualization/HuffmanVisualization/Form1.cs b/HuffmanVisualization/HuffmanVisualization/Form1.cs new file mode 100644 index 0000000..59ba7e5 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/Form1.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace HuffmanVisualization +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanNode.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanNode.cs new file mode 100644 index 0000000..56006b5 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/HuffmanNode.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HuffmanVisualization +{ + using System; + + public class HuffmanNode : IComparable + { + public char Symbol { get; set; } + public int Frequency { get; set; } + public HuffmanNode Left { get; set; } + public HuffmanNode Right { get; set; } + + public HuffmanNode(char symbol, int frequency) + { + Symbol = symbol; + Frequency = frequency; + Left = null; + Right = null; + } + + public int CompareTo(HuffmanNode other) + { + return Frequency - other.Frequency; + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanParameters.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanParameters.cs new file mode 100644 index 0000000..0bddd4d --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/HuffmanParameters.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HuffmanVisualization +{ + public class HuffmanParameters + { + public string InputText { get; set; } + + public HuffmanParameters(string inputText) + { + InputText = inputText; + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanState.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanState.cs new file mode 100644 index 0000000..84d924e --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/HuffmanState.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HuffmanVisualization +{ + public class HuffmanState + { + public HuffmanNode Root { get; set; } + public string SourceText { get; set; } + + public HuffmanState(HuffmanNode root, string sourceText) + { + Root = root; + SourceText = sourceText; + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanStateStorage.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanStateStorage.cs new file mode 100644 index 0000000..2d58ad1 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/HuffmanStateStorage.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; + +namespace HuffmanVisualization +{ + public class HuffmanStateStorage + { + private List states; + private int currentIndex; + + public HuffmanStateStorage() + { + states = new List(); + currentIndex = -1; + } + + public void AddState(HuffmanState state) + { + states.Add(state); + } + + public HuffmanState GetNextState() + { + if (currentIndex < states.Count - 1) + { + currentIndex++; + return states[currentIndex]; + } + return null; + } + + public void Reset() + { + currentIndex = -1; + } + + public void SaveToFile(string filePath) + { + using (Stream stream = File.Open(filePath, FileMode.Create)) + { + BinaryFormatter bin = new BinaryFormatter(); + bin.Serialize(stream, states); + } + } + + public void LoadFromFile(string filePath) + { + using (Stream stream = File.Open(filePath, FileMode.Open)) + { + BinaryFormatter bin = new BinaryFormatter(); + states = (List)bin.Deserialize(stream); + } + currentIndex = -1; + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanTree.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanTree.cs new file mode 100644 index 0000000..6d411b4 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/HuffmanTree.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace HuffmanVisualization +{ + using System; + using System.Collections.Generic; + using System.Linq; + + public class HuffmanTree + { + private HuffmanNode root; + private List nodes; + + public HuffmanTree(string text) + { + // Создаем список узлов для каждого символа в тексте + nodes = text.GroupBy(c => c) + .Select(group => new HuffmanNode + { + Symbol = group.Key, + Frequency = group.Count(), + Left = null, + Right = null + }) + .ToList(); + + // Пока в списке не останется один узел (корень дерева Хаффмана) + while (nodes.Count > 1) + { + // Сортируем узлы по частоте + nodes = nodes.OrderBy(node => node.Frequency).ToList(); + + // Берем первые два узла с наименьшей частотой + HuffmanNode left = nodes[0]; + HuffmanNode right = nodes[1]; + + // Создаем новый узел, который будет родителем для этих двух + HuffmanNode parent = new HuffmanNode + { + Symbol = '*', + Frequency = left.Frequency + right.Frequency, + Left = left, + Right = right + }; + + // Удаляем два узла и добавляем новый + nodes.Remove(left); + nodes.Remove(right); + nodes.Add(parent); + } + + root = nodes.FirstOrDefault(); + } + + public HuffmanNode GetRoot() + { + return root; + } + + // Другие методы, такие как обход дерева, кодирование и декодирование, могут быть реализованы здесь + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanVisualization.csproj b/HuffmanVisualization/HuffmanVisualization/HuffmanVisualization.csproj new file mode 100644 index 0000000..219e87f --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/HuffmanVisualization.csproj @@ -0,0 +1,107 @@ + + + + + Debug + AnyCPU + {BF0D5CA6-F7A2-4240-A727-AEF59108D94E} + WinExe + HuffmanVisualization + HuffmanVisualization + v4.7.2 + 512 + true + true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + Form + + + Form1.cs + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + False + Microsoft .NET Framework 4.7.2 %28x86 и x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanVisualizer.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanVisualizer.cs new file mode 100644 index 0000000..2f59694 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/HuffmanVisualizer.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Drawing; + +namespace HuffmanVisualization +{ + public class HuffmanVisualizer + { + private const int NodeWidth = 50; + private const int NodeHeight = 20; + private const int HorizontalGap = 10; + private const int VerticalGap = 50; + + public Bitmap Visualize(HuffmanState state) + { + // Здесь должен быть код для визуализации дерева Хаффмана. + // Однако, для простоты и краткости, мы просто создадим пустой Bitmap. + return new Bitmap(100, 100); + } + + private void DrawNode(Graphics graphics, HuffmanNode node, int x, int y) + { + // Здесь должен быть код для отрисовки узла дерева Хаффмана. + // Однако, для простоты и краткости, мы просто нарисуем прямоугольник. + graphics.DrawRectangle(Pens.Black, x, y, NodeWidth, NodeHeight); + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/Program.cs b/HuffmanVisualization/HuffmanVisualization/Program.cs new file mode 100644 index 0000000..1afbb09 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace HuffmanVisualization +{ + internal static class Program + { + /// + /// Главная точка входа для приложения. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/AssemblyInfo.cs b/HuffmanVisualization/HuffmanVisualization/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5e3f52a --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанных со сборкой. +[assembly: AssemblyTitle("HuffmanVisualization")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HuffmanVisualization")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, следует установить атрибут ComVisible в TRUE для этого типа. +[assembly: ComVisible(false)] + +// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +[assembly: Guid("bf0d5ca6-f7a2-4240-a727-aef59108d94e")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +// Можно задать все значения или принять номера сборки и редакции по умолчанию +// используя "*", как показано ниже: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/Resources.Designer.cs b/HuffmanVisualization/HuffmanVisualization/Properties/Resources.Designer.cs new file mode 100644 index 0000000..b93bdfe --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программным средством. +// Версия среды выполнения: 4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если +// код создан повторно. +// +//------------------------------------------------------------------------------ + +namespace HuffmanVisualization.Properties +{ + + + /// + /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. + /// + // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder + // класс с помощью таких средств, как ResGen или Visual Studio. + // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen + // с параметром /str или заново постройте свой VS-проект. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HuffmanVisualization.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Переопределяет свойство CurrentUICulture текущего потока для всех + /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/Resources.resx b/HuffmanVisualization/HuffmanVisualization/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/Settings.Designer.cs b/HuffmanVisualization/HuffmanVisualization/Properties/Settings.Designer.cs new file mode 100644 index 0000000..0b7b424 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HuffmanVisualization.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/Settings.settings b/HuffmanVisualization/HuffmanVisualization/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/HuffmanVisualization/HuffmanVisualization/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Laba4aisd/Laba4aisd.sln b/Laba4aisd/Laba4aisd.sln new file mode 100644 index 0000000..a571efb --- /dev/null +++ b/Laba4aisd/Laba4aisd.sln @@ -0,0 +1,51 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Laba4aisd", "Laba4aisd\Laba4aisd.vcxproj", "{035BDD56-BF4E-44C8-A59B-E021E4940416}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zadanie22", "zadanie22\zadanie22.vcxproj", "{EE038EDC-74BB-414C-B90E-D7C793F72FB0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zadanie11", "zadanie11\zadanie11.vcxproj", "{AEC64E83-FB0D-473B-9C55-2380CD92ABA4}" +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 + {035BDD56-BF4E-44C8-A59B-E021E4940416}.Debug|x64.ActiveCfg = Debug|x64 + {035BDD56-BF4E-44C8-A59B-E021E4940416}.Debug|x64.Build.0 = Debug|x64 + {035BDD56-BF4E-44C8-A59B-E021E4940416}.Debug|x86.ActiveCfg = Debug|Win32 + {035BDD56-BF4E-44C8-A59B-E021E4940416}.Debug|x86.Build.0 = Debug|Win32 + {035BDD56-BF4E-44C8-A59B-E021E4940416}.Release|x64.ActiveCfg = Release|x64 + {035BDD56-BF4E-44C8-A59B-E021E4940416}.Release|x64.Build.0 = Release|x64 + {035BDD56-BF4E-44C8-A59B-E021E4940416}.Release|x86.ActiveCfg = Release|Win32 + {035BDD56-BF4E-44C8-A59B-E021E4940416}.Release|x86.Build.0 = Release|Win32 + {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Debug|x64.ActiveCfg = Debug|x64 + {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Debug|x64.Build.0 = Debug|x64 + {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Debug|x86.ActiveCfg = Debug|Win32 + {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Debug|x86.Build.0 = Debug|Win32 + {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Release|x64.ActiveCfg = Release|x64 + {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Release|x64.Build.0 = Release|x64 + {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Release|x86.ActiveCfg = Release|Win32 + {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Release|x86.Build.0 = Release|Win32 + {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Debug|x64.ActiveCfg = Debug|x64 + {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Debug|x64.Build.0 = Debug|x64 + {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Debug|x86.ActiveCfg = Debug|Win32 + {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Debug|x86.Build.0 = Debug|Win32 + {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Release|x64.ActiveCfg = Release|x64 + {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Release|x64.Build.0 = Release|x64 + {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Release|x86.ActiveCfg = Release|Win32 + {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FE66B116-6EAA-4846-B756-4525B5D097A4} + EndGlobalSection +EndGlobal diff --git a/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj b/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj new file mode 100644 index 0000000..d776bf2 --- /dev/null +++ b/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj @@ -0,0 +1,132 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {035bdd56-bf4e-44c8-a59b-e021e4940416} + Laba4aisd + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters b/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters new file mode 100644 index 0000000..153170c --- /dev/null +++ b/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + \ No newline at end of file diff --git a/Laba4aisd/zadanie11/zadanie11.cpp b/Laba4aisd/zadanie11/zadanie11.cpp new file mode 100644 index 0000000..f78230c --- /dev/null +++ b/Laba4aisd/zadanie11/zadanie11.cpp @@ -0,0 +1,65 @@ +#include +#include +#include + +class HashTable { +private: + static const int TABLE_SIZE = 11; + std::vector> table[TABLE_SIZE]; + + int hashFunction1(const std::string& key) { + int hash = 0; + for (char c : key) { + hash = (hash * 31 + c) % TABLE_SIZE; + } + return hash; + } + + int hashFunction2(const std::string& key) { + int hash = 0; + for (char c : key) { + hash = (hash * 17 + c) % (TABLE_SIZE - 1) + 1; + } + return hash; + } + +public: + void insert(const std::string& key, int value) { + int index = hashFunction1(key); + int offset = hashFunction2(key); + + while (!table[index].empty() && table[index].back().first != key) { + index = (index + offset) % TABLE_SIZE; + } + + table[index].push_back(std::make_pair(key, value)); + } + + int search(const std::string& key) { + int index = hashFunction1(key); + int offset = hashFunction2(key); + + while (!table[index].empty() && table[index].back().first != key) { + index = (index + offset) % TABLE_SIZE; + } + + if (!table[index].empty() && table[index].back().first == key) { + return table[index].back().second; + } + else { + return -1; // ключ не найден + } + } +}; + +int main() { + HashTable ht; + + ht.insert("Alice", 30); + ht.insert("Bob", 40); + + std::cout << "Значение для ключа 'Alice': " << ht.search("Alice") << std::endl; + std::cout << "Значение для ключа 'Bob': " << ht.search("Bob") << std::endl; + + return 0; +} \ No newline at end of file diff --git a/Laba4aisd/zadanie11/zadanie11.vcxproj b/Laba4aisd/zadanie11/zadanie11.vcxproj new file mode 100644 index 0000000..97614bb --- /dev/null +++ b/Laba4aisd/zadanie11/zadanie11.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {aec64e83-fb0d-473b-9c55-2380cd92aba4} + zadanie11 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Laba4aisd/zadanie11/zadanie11.vcxproj.filters b/Laba4aisd/zadanie11/zadanie11.vcxproj.filters new file mode 100644 index 0000000..f25d897 --- /dev/null +++ b/Laba4aisd/zadanie11/zadanie11.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/Laba4aisd/zadanie2/zadanie2.vcxproj b/Laba4aisd/zadanie2/zadanie2.vcxproj new file mode 100644 index 0000000..79237a1 --- /dev/null +++ b/Laba4aisd/zadanie2/zadanie2.vcxproj @@ -0,0 +1,138 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + 17.0 + Win32Proj + {3cc79c84-69a5-46a8-9e46-b0ab71bb954a} + zadanie2 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + diff --git a/Laba4aisd/zadanie2/zadanie2.vcxproj.filters b/Laba4aisd/zadanie2/zadanie2.vcxproj.filters new file mode 100644 index 0000000..153170c --- /dev/null +++ b/Laba4aisd/zadanie2/zadanie2.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + \ No newline at end of file diff --git a/Laba4aisd/zadanie22/zadanie22.cpp b/Laba4aisd/zadanie22/zadanie22.cpp new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/Laba4aisd/zadanie22/zadanie22.cpp @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Laba4aisd/zadanie22/zadanie22.vcxproj b/Laba4aisd/zadanie22/zadanie22.vcxproj new file mode 100644 index 0000000..9b5e878 --- /dev/null +++ b/Laba4aisd/zadanie22/zadanie22.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {ee038edc-74bb-414c-b90e-d7c793f72fb0} + zadanie22 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Laba4aisd/zadanie22/zadanie22.vcxproj.filters b/Laba4aisd/zadanie22/zadanie22.vcxproj.filters new file mode 100644 index 0000000..780f3c0 --- /dev/null +++ b/Laba4aisd/zadanie22/zadanie22.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/Tank/Tank/Entities/EntityMachine.cs b/Tank/Tank/Entities/EntityMachine.cs index 2716dad..011107c 100644 --- a/Tank/Tank/Entities/EntityMachine.cs +++ b/Tank/Tank/Entities/EntityMachine.cs @@ -36,4 +36,9 @@ public class EntityMachine Weight = weight; BodyColor = bodyColor; } + + internal void SetBodyColor(Color color) + { + throw new NotImplementedException(); + } } diff --git a/Tank/Tank/FormTankCollection.Designer.cs b/Tank/Tank/FormTankCollection.Designer.cs index cb5f01a..d379dff 100644 --- a/Tank/Tank/FormTankCollection.Designer.cs +++ b/Tank/Tank/FormTankCollection.Designer.cs @@ -31,7 +31,6 @@ groupBoxTools = new GroupBox(); panelCompanyTools = new Panel(); buttonAddTank = new Button(); - buttonAddMachine = new Button(); maskedTextBoxPosition = new MaskedTextBox(); buttonRefresh = new Button(); buttonDelTank = new Button(); @@ -70,7 +69,6 @@ // panelCompanyTools // panelCompanyTools.Controls.Add(buttonAddTank); - panelCompanyTools.Controls.Add(buttonAddMachine); panelCompanyTools.Controls.Add(maskedTextBoxPosition); panelCompanyTools.Controls.Add(buttonRefresh); panelCompanyTools.Controls.Add(buttonDelTank); @@ -92,18 +90,7 @@ buttonAddTank.TabIndex = 1; buttonAddTank.Text = "Добавление танка"; buttonAddTank.UseVisualStyleBackColor = true; - buttonAddTank.Click += ButtonAddTank_Click; - // - // buttonAddMachine - // - buttonAddMachine.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; - buttonAddMachine.Location = new Point(33, 59); - buttonAddMachine.Name = "buttonAddMachine"; - buttonAddMachine.Size = new Size(307, 50); - buttonAddMachine.TabIndex = 2; - buttonAddMachine.Text = "Добавление машины"; - buttonAddMachine.UseVisualStyleBackColor = true; - buttonAddMachine.Click += ButtonAddMachine_Click; + // // maskedTextBoxPosition // @@ -281,7 +268,6 @@ #endregion private GroupBox groupBoxTools; - private Button buttonAddMachine; private Button buttonAddTank; private PictureBox pictureBox; private Button buttonGoToCheck; diff --git a/Tank/Tank/FormTankCollection.cs b/Tank/Tank/FormTankCollection.cs index dd89ab9..8763c0e 100644 --- a/Tank/Tank/FormTankCollection.cs +++ b/Tank/Tank/FormTankCollection.cs @@ -49,12 +49,7 @@ public partial class FormTankCollection : Form /// /// private void ButtonAddMachine_Click(object sender, EventArgs e) => CreateObject(nameof(DrawningMachine)); - /// - /// Добавление спортивного автомобиля - /// - /// - /// - private void ButtonAddTank_Click(object sender, EventArgs e) => CreateObject(nameof(DrawningTank)); + /// ///Создание объекта класса-перемещения /// diff --git a/labalaba3/labalaba3/zadanie1.cpp b/labalaba3/labalaba3/zadanie1.cpp index d4beaba..0de224d 100644 --- a/labalaba3/labalaba3/zadanie1.cpp +++ b/labalaba3/labalaba3/zadanie1.cpp @@ -1,82 +1,52 @@ -#include +#include #include -#include -#include -#include -#include +#include -using namespace std; +class HashTable { +private: + static const int TABLE_SIZE = 11; + std::vector> table[TABLE_SIZE]; -typedef pair iPair; + int hashFunction1(const std::string& key) { + int hash = 0; + for (char c : key) { + hash = (hash * 31 + c) % TABLE_SIZE; + } + return hash; + } -class Graph { - int V; - list>* adj; + int hashFunction2(const std::string& key) { + int hash = 0; + for (char c : key) { + hash = (hash * 17 + c) % (TABLE_SIZE - 1) + 1; + } + return hash; + } public: - Graph(int V) { - this->V = V; - adj = new list[V]; + void insert(const std::string& key, int value) { + int index = hashFunction1(key); + int offset = hashFunction2(key); + while (!table[index].empty() && table[index].back().first != key) { + index = (index + offset) % TABLE_SIZE; + } + table[index].push_back(std::make_pair(key, value)); } - void addEdge(int u, int v, int w) { - adj[u].push_back(make_pair(v, w)); - adj[v].push_back(make_pair(u, w)); - } - - void shortestPath(int src) { - vector dist(V, INT_MAX); - set pq; - - dist[src] = 0; - pq.insert(make_pair(0, src)); - - while (!pq.empty()) { - int u = pq.begin()->second; - pq.erase(pq.begin()); - - for (auto i = adj[u].begin(); i != adj[u].end(); ++i) { - int v = (*i).first; - int weight = (*i).second; - - if (dist[v] > dist[u] + weight) { - if (dist[v] != INT_MAX) { - pq.erase(pq.find(make_pair(dist[v], v))); - } - - dist[v] = dist[u] + weight; - pq.insert(make_pair(dist[v], v)); - } - } - } - - cout << "Vertex Distance from Source\n"; - for (int i = 0; i < V; ++i) { - cout << i << "\t\t" << dist[i] << endl; + int search(const std::string& key) { + int index = hashFunction1(key); + int offset = hashFunction2(key); + while (!table[index].empty() && table[index].back().first != key) { + index = (index + offset) % TABLE_SIZE; } + return table[index].empty() ? -1 : table[index].back().second; } }; int main() { - int V = 9; - Graph g(V); - - g.addEdge(0, 1, 4); - g.addEdge(0, 7, 8); - g.addEdge(1, 2, 8); - g.addEdge(1, 7, 11); - g.addEdge(2, 3, 7); - g.addEdge(2, 8, 2); - g.addEdge(2, 5, 4); - g.addEdge(3, 4, 9); - g.addEdge(3, 5, 14); - g.addEdge(4, 5, 10); - g.addEdge(5, 6, 2); - g.addEdge(6, 7, 1); - g.addEdge(6, 8, 6); - g.addEdge(7, 8, 7); - - g.shortestPath(0); - + HashTable ht; + ht.insert("Alice", 30); + ht.insert("Bob", 40); + std::cout << ht.search("Alice") << " " << ht.search("Bob") << std::endl; return 0; } \ No newline at end of file diff --git a/labalaba3/lll/zadanie2.cpp b/labalaba3/lll/zadanie2.cpp index 343f3d7..42fd391 100644 --- a/labalaba3/lll/zadanie2.cpp +++ b/labalaba3/lll/zadanie2.cpp @@ -1,59 +1,48 @@ -#include +#include #include -#include +#include +#include -using namespace std; +class HashTable { +private: + static const int TABLE_SIZE = 10; + std::vector>> table; -class Graph { - int V; - list* adj; + int hashFunction(const std::string& key) { + int hash = 0; + for (char c : key) { + hash = (hash * 31 + c) % TABLE_SIZE; + } + return hash; + } public: - Graph(int V) { - this->V = V; - adj = new list[V]; + HashTable() : table(TABLE_SIZE) {} + + void insert(const std::string& key, int value) { + int index = hashFunction(key); + table[index].push_back(std::make_pair(key, value)); } - void addEdge(int v, int w) { - adj[v].push_back(w); - } - - void BFS(int s) { - bool* visited = new bool[V]; - for (int i = 0; i < V; i++) - visited[i] = false; - - queue queue; - - visited[s] = true; - queue.push(s); - - while (!queue.empty()) { - s = queue.front(); - cout << s << " "; - queue.pop(); - - for (auto i = adj[s].begin(); i != adj[s].end(); ++i) { - if (!visited[*i]) { - visited[*i] = true; - queue.push(*i); - } + int search(const std::string& key) { + int index = hashFunction(key); + for (const auto& pair : table[index]) { + if (pair.first == key) { + return pair.second; // найдено значение } } + return -1; // значение не найдено } }; int main() { - Graph g(4); - g.addEdge(0, 1); - g.addEdge(0, 2); - g.addEdge(1, 2); - g.addEdge(2, 0); - g.addEdge(2, 3); - g.addEdge(3, 3); + HashTable ht; - cout << "Breadth First Traversal (starting from vertex 2): "; - g.BFS(2); + ht.insert("Alice", 30); + ht.insert("Bob", 40); + + std::cout << "Значение для ключа 'Alice': " << ht.search("Alice") << std::endl; + std::cout << "Значение для ключа 'Bob': " << ht.search("Bob") << std::endl; return 0; } \ No newline at end of file diff --git a/labalaba3/llll/zadanie3.cpp b/labalaba3/llll/zadanie3.cpp index 98a1ad7..2faf57c 100644 --- a/labalaba3/llll/zadanie3.cpp +++ b/labalaba3/llll/zadanie3.cpp @@ -1,59 +1,32 @@ -#include +#include #include -#include - +#include using namespace std; - -#define V 5 - -int minKey(int key[], bool mstSet[]) { - int min = INT_MAX, min_index; - - for (int v = 0; v < V; v++) - if (mstSet[v] == false && key[v] < min) - min = key[v], min_index = v; - - return min_index; -} - -void printMST(int parent[], int graph[V][V]) { - cout << "Edge \tWeight\n"; - for (int i = 1; i < V; i++) - cout << parent[i] << " - " << i << " \t" << graph[i][parent[i]] << " \n"; -} - -void primMST(int graph[V][V]) { - int parent[V]; - int key[V]; - bool mstSet[V]; - - for (int i = 0; i < V; i++) - key[i] = INT_MAX, mstSet[i] = false; - - key[0] = 0; - parent[0] = -1; - - for (int count = 0; count < V - 1; count++) { - int u = minKey(key, mstSet); - - mstSet[u] = true; - - for (int v = 0; v < V; v++) - if (graph[u][v] && mstSet[v] == false && graph[u][v] < key[v]) - parent[v] = u, key[v] = graph[u][v]; - } - - printMST(parent, graph); -} - +struct M { string t; int y; double r; }; +struct N { M m; N* n; N(M m) :m(m), n(nullptr) {} }; +class D { +N* f, * r; public:D() :f(nullptr), r(nullptr) {} + void i(M m) { N* n = new N(m); if (!f)f = r = n; else { n->n = f; f = n; } } + void a(M m) { N* n = new N(m); if (!f)f = r = n; else { r->n = n; r = n; } } + void rf() { if (f) { N* t = f; f = f->n; delete t; if (!f)r = nullptr; } } + void rr() { if (f) { if (f == r) { delete f; f = r = nullptr; } else { N* t = f; while (t->n != r)t = t->n; delete r; r = t; r->n = nullptr; } } } + M gf() { return f->m; } + M gr() { return r->m; } +}; +void b(vector& m) { int n = m.size(); for (int i = 0; i < n - 1; ++i)for (int j = 0; j < n - i - 1; ++j)if (m[j].r > m[j + 1].r)swap(m[j], m[j + 1]); } +int p(vector& m, int l, int h) { double p = m[h].r; int i = l - 1; for (int j = l; j <= h - 1; ++j)if (m[j].r < p) { ++i; swap(m[i], m[j]); }swap(m[i + 1], m[h]); return i + 1; } +void q(vector& m, int l, int h) { if (l < h) { int pi = p(m, l, h); q(m, l, pi - 1); q(m, pi + 1, h); } } int main() { - int graph[V][V] = { { 0, 2, 0, 6, 0 }, - { 2, 0, 3, 8, 5 }, - { 0, 3, 0, 0, 7 }, - { 6, 8, 0, 0, 9 }, - { 0, 5, 7, 9, 0 } }; - - primMST(graph); - + D d; + d.i({ "M1",2000,8.5 }); + d.a({ "M2",2005,9.0 }); + d.i({ "M3",2010,7.8 }); + vector m = { {"MA",2002,8.2}, {"MB",2008,7.5}, {"MC",2015,9.1}, {"MD",2018,8.7} }; + b(m); + for (M& e : m) + cout << e.t << " " << e.y << " " << e.r << endl; + q(m, 0, m.size() - 1); + for (M& e : m) + cout << e.t << " " << e.y << " " << e.r << endl; return 0; } \ No newline at end of file diff --git a/labalaba3/zad4/zad4.cpp b/labalaba3/zad4/zad4.cpp new file mode 100644 index 0000000..769fb9f --- /dev/null +++ b/labalaba3/zad4/zad4.cpp @@ -0,0 +1,20 @@ +// zad4.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. +// + +#include + +int main() +{ + std::cout << "Hello World!\n"; +} + +// Запуск программы: CTRL+F5 или меню "Отладка" > "Запуск без отладки" +// Отладка программы: F5 или меню "Отладка" > "Запустить отладку" + +// Советы по началу работы +// 1. В окне обозревателя решений можно добавлять файлы и управлять ими. +// 2. В окне Team Explorer можно подключиться к системе управления версиями. +// 3. В окне "Выходные данные" можно просматривать выходные данные сборки и другие сообщения. +// 4. В окне "Список ошибок" можно просматривать ошибки. +// 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. +// 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. diff --git a/labalaba3/zad4/zad4.vcxproj b/labalaba3/zad4/zad4.vcxproj new file mode 100644 index 0000000..e540384 --- /dev/null +++ b/labalaba3/zad4/zad4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {78672faf-3e00-428c-bb07-f993a1958574} + zad4 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/labalaba3/zad4/zad4.vcxproj.filters b/labalaba3/zad4/zad4.vcxproj.filters new file mode 100644 index 0000000..d77f914 --- /dev/null +++ b/labalaba3/zad4/zad4.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file -- 2.25.1 From 0c44d0f86aab12c98f26dae3ab801db3297d33a0 Mon Sep 17 00:00:00 2001 From: elizaveta Date: Wed, 12 Jun 2024 23:31:45 +0400 Subject: [PATCH 2/3] bbb --- Huffman/Huffman.sln | 25 --- Huffman/Huffman/Form1.Designer.cs | 39 ----- Huffman/Huffman/Form1.cs | 10 -- Huffman/Huffman/Form1.resx | 120 -------------- Huffman/Huffman/Huffman.csproj | 11 -- Huffman/Huffman/Program.cs | 17 -- HuffmanState/HuffmanState.sln | 31 ---- HuffmanState/HuffmanState/HuffmanCoding.h | 0 HuffmanState/HuffmanState/HuffmanManager.h | 0 .../HuffmanState/HuffmanParameters.cpp | 0 HuffmanState/HuffmanState/HuffmanParameters.h | 0 HuffmanState/HuffmanState/HuffmanState.cpp | 20 --- HuffmanState/HuffmanState/HuffmanState.h | 0 .../HuffmanState/HuffmanState.vcxproj | 135 --------------- .../HuffmanState/HuffmanState.vcxproj.filters | 22 --- HuffmanState/HuffmanState/HuffmanStorage.cpp | 0 HuffmanState/HuffmanState/HuffmanStorage.h | 0 .../HuffmanState/HuffmanVisualizer.cpp | 0 HuffmanState/HuffmanState/HuffmanVisualizer.h | 0 HuffmanVisualization/HuffmanVisualization.sln | 25 --- .../HuffmanVisualization/App.config | 6 - .../HuffmanVisualization/Form1.Designer.cs | 39 ----- .../HuffmanVisualization/Form1.cs | 20 --- .../HuffmanVisualization/HuffmanNode.cs | 31 ---- .../HuffmanVisualization/HuffmanParameters.cs | 18 -- .../HuffmanVisualization/HuffmanState.cs | 20 --- .../HuffmanStateStorage.cs | 61 ------- .../HuffmanVisualization/HuffmanTree.cs | 67 -------- .../HuffmanVisualization.csproj | 107 ------------ .../HuffmanVisualization/HuffmanVisualizer.cs | 32 ---- .../HuffmanVisualization/Program.cs | 22 --- .../Properties/AssemblyInfo.cs | 36 ---- .../Properties/Resources.Designer.cs | 71 -------- .../Properties/Resources.resx | 117 ------------- .../Properties/Settings.Designer.cs | 30 ---- .../Properties/Settings.settings | 7 - Laba4aisd/Laba4aisd.sln | 51 ------ Laba4aisd/Laba4aisd/Laba4aisd.vcxproj | 132 --------------- Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters | 17 -- Laba4aisd/zadanie11/zadanie11.cpp | 65 -------- Laba4aisd/zadanie11/zadanie11.vcxproj | 135 --------------- Laba4aisd/zadanie11/zadanie11.vcxproj.filters | 22 --- Laba4aisd/zadanie2/zadanie2.vcxproj | 138 ---------------- Laba4aisd/zadanie2/zadanie2.vcxproj.filters | 17 -- Laba4aisd/zadanie22/zadanie22.cpp | 1 - Laba4aisd/zadanie22/zadanie22.vcxproj | 135 --------------- Laba4aisd/zadanie22/zadanie22.vcxproj.filters | 22 --- labalaba2/lab2/SourceZhadny.cpp | 135 --------------- labalaba2/lab2/lab2.vcxproj | 135 --------------- labalaba2/lab2/lab2.vcxproj.filters | 22 --- labalaba2/lab2z3/Zadanie3.cpp | 63 ------- labalaba2/lab2z3/lab2z3.vcxproj | 135 --------------- labalaba2/lab2z3/lab2z3.vcxproj.filters | 22 --- labalaba2/labalaba2.sln | 51 ------ labalaba2/labalaba2/SourceDinam.cpp | 154 ------------------ labalaba2/labalaba2/labalaba2.vcxproj | 135 --------------- labalaba2/labalaba2/labalaba2.vcxproj.filters | 22 --- labalaba3/labalaba3.sln | 51 ------ labalaba3/labalaba3/labalaba3.vcxproj | 135 --------------- labalaba3/labalaba3/labalaba3.vcxproj.filters | 22 --- labalaba3/labalaba3/zadanie1.cpp | 52 ------ labalaba3/lll/lll.vcxproj | 135 --------------- labalaba3/lll/lll.vcxproj.filters | 22 --- labalaba3/lll/zadanie2.cpp | 48 ------ labalaba3/llll/llll.vcxproj | 135 --------------- labalaba3/llll/llll.vcxproj.filters | 22 --- labalaba3/llll/zadanie3.cpp | 32 ---- labalaba3/zad4/zad4.cpp | 20 --- labalaba3/zad4/zad4.vcxproj | 135 --------------- labalaba3/zad4/zad4.vcxproj.filters | 22 --- 70 files changed, 3579 deletions(-) delete mode 100644 Huffman/Huffman.sln delete mode 100644 Huffman/Huffman/Form1.Designer.cs delete mode 100644 Huffman/Huffman/Form1.cs delete mode 100644 Huffman/Huffman/Form1.resx delete mode 100644 Huffman/Huffman/Huffman.csproj delete mode 100644 Huffman/Huffman/Program.cs delete mode 100644 HuffmanState/HuffmanState.sln delete mode 100644 HuffmanState/HuffmanState/HuffmanCoding.h delete mode 100644 HuffmanState/HuffmanState/HuffmanManager.h delete mode 100644 HuffmanState/HuffmanState/HuffmanParameters.cpp delete mode 100644 HuffmanState/HuffmanState/HuffmanParameters.h delete mode 100644 HuffmanState/HuffmanState/HuffmanState.cpp delete mode 100644 HuffmanState/HuffmanState/HuffmanState.h delete mode 100644 HuffmanState/HuffmanState/HuffmanState.vcxproj delete mode 100644 HuffmanState/HuffmanState/HuffmanState.vcxproj.filters delete mode 100644 HuffmanState/HuffmanState/HuffmanStorage.cpp delete mode 100644 HuffmanState/HuffmanState/HuffmanStorage.h delete mode 100644 HuffmanState/HuffmanState/HuffmanVisualizer.cpp delete mode 100644 HuffmanState/HuffmanState/HuffmanVisualizer.h delete mode 100644 HuffmanVisualization/HuffmanVisualization.sln delete mode 100644 HuffmanVisualization/HuffmanVisualization/App.config delete mode 100644 HuffmanVisualization/HuffmanVisualization/Form1.Designer.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/Form1.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanNode.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanParameters.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanState.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanStateStorage.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanTree.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanVisualization.csproj delete mode 100644 HuffmanVisualization/HuffmanVisualization/HuffmanVisualizer.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/Program.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/AssemblyInfo.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/Resources.Designer.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/Resources.resx delete mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/Settings.Designer.cs delete mode 100644 HuffmanVisualization/HuffmanVisualization/Properties/Settings.settings delete mode 100644 Laba4aisd/Laba4aisd.sln delete mode 100644 Laba4aisd/Laba4aisd/Laba4aisd.vcxproj delete mode 100644 Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters delete mode 100644 Laba4aisd/zadanie11/zadanie11.cpp delete mode 100644 Laba4aisd/zadanie11/zadanie11.vcxproj delete mode 100644 Laba4aisd/zadanie11/zadanie11.vcxproj.filters delete mode 100644 Laba4aisd/zadanie2/zadanie2.vcxproj delete mode 100644 Laba4aisd/zadanie2/zadanie2.vcxproj.filters delete mode 100644 Laba4aisd/zadanie22/zadanie22.cpp delete mode 100644 Laba4aisd/zadanie22/zadanie22.vcxproj delete mode 100644 Laba4aisd/zadanie22/zadanie22.vcxproj.filters delete mode 100644 labalaba2/lab2/SourceZhadny.cpp delete mode 100644 labalaba2/lab2/lab2.vcxproj delete mode 100644 labalaba2/lab2/lab2.vcxproj.filters delete mode 100644 labalaba2/lab2z3/Zadanie3.cpp delete mode 100644 labalaba2/lab2z3/lab2z3.vcxproj delete mode 100644 labalaba2/lab2z3/lab2z3.vcxproj.filters delete mode 100644 labalaba2/labalaba2.sln delete mode 100644 labalaba2/labalaba2/SourceDinam.cpp delete mode 100644 labalaba2/labalaba2/labalaba2.vcxproj delete mode 100644 labalaba2/labalaba2/labalaba2.vcxproj.filters delete mode 100644 labalaba3/labalaba3.sln delete mode 100644 labalaba3/labalaba3/labalaba3.vcxproj delete mode 100644 labalaba3/labalaba3/labalaba3.vcxproj.filters delete mode 100644 labalaba3/labalaba3/zadanie1.cpp delete mode 100644 labalaba3/lll/lll.vcxproj delete mode 100644 labalaba3/lll/lll.vcxproj.filters delete mode 100644 labalaba3/lll/zadanie2.cpp delete mode 100644 labalaba3/llll/llll.vcxproj delete mode 100644 labalaba3/llll/llll.vcxproj.filters delete mode 100644 labalaba3/llll/zadanie3.cpp delete mode 100644 labalaba3/zad4/zad4.cpp delete mode 100644 labalaba3/zad4/zad4.vcxproj delete mode 100644 labalaba3/zad4/zad4.vcxproj.filters diff --git a/Huffman/Huffman.sln b/Huffman/Huffman.sln deleted file mode 100644 index fa966c2..0000000 --- a/Huffman/Huffman.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Huffman", "Huffman\Huffman.csproj", "{D460B444-2BA9-4EE5-85C1-4B186B729B07}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D460B444-2BA9-4EE5-85C1-4B186B729B07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D460B444-2BA9-4EE5-85C1-4B186B729B07}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D460B444-2BA9-4EE5-85C1-4B186B729B07}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D460B444-2BA9-4EE5-85C1-4B186B729B07}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {77D0B3F5-7E0E-4348-B895-3BF868174E5B} - EndGlobalSection -EndGlobal diff --git a/Huffman/Huffman/Form1.Designer.cs b/Huffman/Huffman/Form1.Designer.cs deleted file mode 100644 index 7dab7c1..0000000 --- a/Huffman/Huffman/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace Huffman -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; - } - - #endregion - } -} \ No newline at end of file diff --git a/Huffman/Huffman/Form1.cs b/Huffman/Huffman/Form1.cs deleted file mode 100644 index 55c06d0..0000000 --- a/Huffman/Huffman/Form1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Huffman -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/Huffman/Huffman/Form1.resx b/Huffman/Huffman/Form1.resx deleted file mode 100644 index 1af7de1..0000000 --- a/Huffman/Huffman/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Huffman/Huffman/Huffman.csproj b/Huffman/Huffman/Huffman.csproj deleted file mode 100644 index b57c89e..0000000 --- a/Huffman/Huffman/Huffman.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - WinExe - net6.0-windows - enable - true - enable - - - \ No newline at end of file diff --git a/Huffman/Huffman/Program.cs b/Huffman/Huffman/Program.cs deleted file mode 100644 index c99272a..0000000 --- a/Huffman/Huffman/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Huffman -{ - internal static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - // To customize application configuration such as set high DPI settings or default font, - // see https://aka.ms/applicationconfiguration. - ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); - } - } -} \ No newline at end of file diff --git a/HuffmanState/HuffmanState.sln b/HuffmanState/HuffmanState.sln deleted file mode 100644 index f243be2..0000000 --- a/HuffmanState/HuffmanState.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HuffmanState", "HuffmanState\HuffmanState.vcxproj", "{D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}" -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 - {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Debug|x64.ActiveCfg = Debug|x64 - {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Debug|x64.Build.0 = Debug|x64 - {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Debug|x86.ActiveCfg = Debug|Win32 - {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Debug|x86.Build.0 = Debug|Win32 - {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Release|x64.ActiveCfg = Release|x64 - {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Release|x64.Build.0 = Release|x64 - {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Release|x86.ActiveCfg = Release|Win32 - {D0284C25-617E-4E28-BCF4-C9C4D6ED25D4}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {230F865B-1C2E-47B2-B59C-E8D81365476C} - EndGlobalSection -EndGlobal diff --git a/HuffmanState/HuffmanState/HuffmanCoding.h b/HuffmanState/HuffmanState/HuffmanCoding.h deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanState/HuffmanState/HuffmanManager.h b/HuffmanState/HuffmanState/HuffmanManager.h deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanState/HuffmanState/HuffmanParameters.cpp b/HuffmanState/HuffmanState/HuffmanParameters.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanState/HuffmanState/HuffmanParameters.h b/HuffmanState/HuffmanState/HuffmanParameters.h deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanState/HuffmanState/HuffmanState.cpp b/HuffmanState/HuffmanState/HuffmanState.cpp deleted file mode 100644 index 8e03ddb..0000000 --- a/HuffmanState/HuffmanState/HuffmanState.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// HuffmanState.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. -// - -#include - -int main() -{ - std::cout << "Hello World!\n"; -} - -// Запуск программы: CTRL+F5 или меню "Отладка" > "Запуск без отладки" -// Отладка программы: F5 или меню "Отладка" > "Запустить отладку" - -// Советы по началу работы -// 1. В окне обозревателя решений можно добавлять файлы и управлять ими. -// 2. В окне Team Explorer можно подключиться к системе управления версиями. -// 3. В окне "Выходные данные" можно просматривать выходные данные сборки и другие сообщения. -// 4. В окне "Список ошибок" можно просматривать ошибки. -// 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. -// 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. diff --git a/HuffmanState/HuffmanState/HuffmanState.h b/HuffmanState/HuffmanState/HuffmanState.h deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanState/HuffmanState/HuffmanState.vcxproj b/HuffmanState/HuffmanState/HuffmanState.vcxproj deleted file mode 100644 index e768375..0000000 --- a/HuffmanState/HuffmanState/HuffmanState.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {d0284c25-617e-4e28-bcf4-c9c4d6ed25d4} - HuffmanState - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/HuffmanState/HuffmanState/HuffmanState.vcxproj.filters b/HuffmanState/HuffmanState/HuffmanState.vcxproj.filters deleted file mode 100644 index 56ba9db..0000000 --- a/HuffmanState/HuffmanState/HuffmanState.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/HuffmanState/HuffmanState/HuffmanStorage.cpp b/HuffmanState/HuffmanState/HuffmanStorage.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanState/HuffmanState/HuffmanStorage.h b/HuffmanState/HuffmanState/HuffmanStorage.h deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanState/HuffmanState/HuffmanVisualizer.cpp b/HuffmanState/HuffmanState/HuffmanVisualizer.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanState/HuffmanState/HuffmanVisualizer.h b/HuffmanState/HuffmanState/HuffmanVisualizer.h deleted file mode 100644 index e69de29..0000000 diff --git a/HuffmanVisualization/HuffmanVisualization.sln b/HuffmanVisualization/HuffmanVisualization.sln deleted file mode 100644 index fd8e9a0..0000000 --- a/HuffmanVisualization/HuffmanVisualization.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HuffmanVisualization", "HuffmanVisualization\HuffmanVisualization.csproj", "{BF0D5CA6-F7A2-4240-A727-AEF59108D94E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BF0D5CA6-F7A2-4240-A727-AEF59108D94E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF0D5CA6-F7A2-4240-A727-AEF59108D94E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF0D5CA6-F7A2-4240-A727-AEF59108D94E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF0D5CA6-F7A2-4240-A727-AEF59108D94E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {335046B9-A8A6-4ACF-A7BC-22D6FD6ADF8B} - EndGlobalSection -EndGlobal diff --git a/HuffmanVisualization/HuffmanVisualization/App.config b/HuffmanVisualization/HuffmanVisualization/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/HuffmanVisualization/HuffmanVisualization/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/HuffmanVisualization/HuffmanVisualization/Form1.Designer.cs b/HuffmanVisualization/HuffmanVisualization/Form1.Designer.cs deleted file mode 100644 index f293371..0000000 --- a/HuffmanVisualization/HuffmanVisualization/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace HuffmanVisualization -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; - } - - #endregion - } -} \ No newline at end of file diff --git a/HuffmanVisualization/HuffmanVisualization/Form1.cs b/HuffmanVisualization/HuffmanVisualization/Form1.cs deleted file mode 100644 index 59ba7e5..0000000 --- a/HuffmanVisualization/HuffmanVisualization/Form1.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace HuffmanVisualization -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanNode.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanNode.cs deleted file mode 100644 index 56006b5..0000000 --- a/HuffmanVisualization/HuffmanVisualization/HuffmanNode.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HuffmanVisualization -{ - using System; - - public class HuffmanNode : IComparable - { - public char Symbol { get; set; } - public int Frequency { get; set; } - public HuffmanNode Left { get; set; } - public HuffmanNode Right { get; set; } - - public HuffmanNode(char symbol, int frequency) - { - Symbol = symbol; - Frequency = frequency; - Left = null; - Right = null; - } - - public int CompareTo(HuffmanNode other) - { - return Frequency - other.Frequency; - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanParameters.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanParameters.cs deleted file mode 100644 index 0bddd4d..0000000 --- a/HuffmanVisualization/HuffmanVisualization/HuffmanParameters.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HuffmanVisualization -{ - public class HuffmanParameters - { - public string InputText { get; set; } - - public HuffmanParameters(string inputText) - { - InputText = inputText; - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanState.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanState.cs deleted file mode 100644 index 84d924e..0000000 --- a/HuffmanVisualization/HuffmanVisualization/HuffmanState.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HuffmanVisualization -{ - public class HuffmanState - { - public HuffmanNode Root { get; set; } - public string SourceText { get; set; } - - public HuffmanState(HuffmanNode root, string sourceText) - { - Root = root; - SourceText = sourceText; - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanStateStorage.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanStateStorage.cs deleted file mode 100644 index 2d58ad1..0000000 --- a/HuffmanVisualization/HuffmanVisualization/HuffmanStateStorage.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.IO; -using System.Runtime.Serialization.Formatters.Binary; - -namespace HuffmanVisualization -{ - public class HuffmanStateStorage - { - private List states; - private int currentIndex; - - public HuffmanStateStorage() - { - states = new List(); - currentIndex = -1; - } - - public void AddState(HuffmanState state) - { - states.Add(state); - } - - public HuffmanState GetNextState() - { - if (currentIndex < states.Count - 1) - { - currentIndex++; - return states[currentIndex]; - } - return null; - } - - public void Reset() - { - currentIndex = -1; - } - - public void SaveToFile(string filePath) - { - using (Stream stream = File.Open(filePath, FileMode.Create)) - { - BinaryFormatter bin = new BinaryFormatter(); - bin.Serialize(stream, states); - } - } - - public void LoadFromFile(string filePath) - { - using (Stream stream = File.Open(filePath, FileMode.Open)) - { - BinaryFormatter bin = new BinaryFormatter(); - states = (List)bin.Deserialize(stream); - } - currentIndex = -1; - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanTree.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanTree.cs deleted file mode 100644 index 6d411b4..0000000 --- a/HuffmanVisualization/HuffmanVisualization/HuffmanTree.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace HuffmanVisualization -{ - using System; - using System.Collections.Generic; - using System.Linq; - - public class HuffmanTree - { - private HuffmanNode root; - private List nodes; - - public HuffmanTree(string text) - { - // Создаем список узлов для каждого символа в тексте - nodes = text.GroupBy(c => c) - .Select(group => new HuffmanNode - { - Symbol = group.Key, - Frequency = group.Count(), - Left = null, - Right = null - }) - .ToList(); - - // Пока в списке не останется один узел (корень дерева Хаффмана) - while (nodes.Count > 1) - { - // Сортируем узлы по частоте - nodes = nodes.OrderBy(node => node.Frequency).ToList(); - - // Берем первые два узла с наименьшей частотой - HuffmanNode left = nodes[0]; - HuffmanNode right = nodes[1]; - - // Создаем новый узел, который будет родителем для этих двух - HuffmanNode parent = new HuffmanNode - { - Symbol = '*', - Frequency = left.Frequency + right.Frequency, - Left = left, - Right = right - }; - - // Удаляем два узла и добавляем новый - nodes.Remove(left); - nodes.Remove(right); - nodes.Add(parent); - } - - root = nodes.FirstOrDefault(); - } - - public HuffmanNode GetRoot() - { - return root; - } - - // Другие методы, такие как обход дерева, кодирование и декодирование, могут быть реализованы здесь - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanVisualization.csproj b/HuffmanVisualization/HuffmanVisualization/HuffmanVisualization.csproj deleted file mode 100644 index 219e87f..0000000 --- a/HuffmanVisualization/HuffmanVisualization/HuffmanVisualization.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - - Debug - AnyCPU - {BF0D5CA6-F7A2-4240-A727-AEF59108D94E} - WinExe - HuffmanVisualization - HuffmanVisualization - v4.7.2 - 512 - true - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - Form - - - Form1.cs - - - - - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - False - Microsoft .NET Framework 4.7.2 %28x86 и x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - \ No newline at end of file diff --git a/HuffmanVisualization/HuffmanVisualization/HuffmanVisualizer.cs b/HuffmanVisualization/HuffmanVisualization/HuffmanVisualizer.cs deleted file mode 100644 index 2f59694..0000000 --- a/HuffmanVisualization/HuffmanVisualization/HuffmanVisualizer.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Drawing; - -namespace HuffmanVisualization -{ - public class HuffmanVisualizer - { - private const int NodeWidth = 50; - private const int NodeHeight = 20; - private const int HorizontalGap = 10; - private const int VerticalGap = 50; - - public Bitmap Visualize(HuffmanState state) - { - // Здесь должен быть код для визуализации дерева Хаффмана. - // Однако, для простоты и краткости, мы просто создадим пустой Bitmap. - return new Bitmap(100, 100); - } - - private void DrawNode(Graphics graphics, HuffmanNode node, int x, int y) - { - // Здесь должен быть код для отрисовки узла дерева Хаффмана. - // Однако, для простоты и краткости, мы просто нарисуем прямоугольник. - graphics.DrawRectangle(Pens.Black, x, y, NodeWidth, NodeHeight); - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/Program.cs b/HuffmanVisualization/HuffmanVisualization/Program.cs deleted file mode 100644 index 1afbb09..0000000 --- a/HuffmanVisualization/HuffmanVisualization/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace HuffmanVisualization -{ - internal static class Program - { - /// - /// Главная точка входа для приложения. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/AssemblyInfo.cs b/HuffmanVisualization/HuffmanVisualization/Properties/AssemblyInfo.cs deleted file mode 100644 index 5e3f52a..0000000 --- a/HuffmanVisualization/HuffmanVisualization/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// Общие сведения об этой сборке предоставляются следующим набором -// набора атрибутов. Измените значения этих атрибутов для изменения сведений, -// связанных со сборкой. -[assembly: AssemblyTitle("HuffmanVisualization")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HuffmanVisualization")] -[assembly: AssemblyCopyright("Copyright © 2024")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми -// для компонентов COM. Если необходимо обратиться к типу в этой сборке через -// COM, следует установить атрибут ComVisible в TRUE для этого типа. -[assembly: ComVisible(false)] - -// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM -[assembly: Guid("bf0d5ca6-f7a2-4240-a727-aef59108d94e")] - -// Сведения о версии сборки состоят из указанных ниже четырех значений: -// -// Основной номер версии -// Дополнительный номер версии -// Номер сборки -// Редакция -// -// Можно задать все значения или принять номера сборки и редакции по умолчанию -// используя "*", как показано ниже: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/Resources.Designer.cs b/HuffmanVisualization/HuffmanVisualization/Properties/Resources.Designer.cs deleted file mode 100644 index b93bdfe..0000000 --- a/HuffmanVisualization/HuffmanVisualization/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Этот код создан программным средством. -// Версия среды выполнения: 4.0.30319.42000 -// -// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если -// код создан повторно. -// -//------------------------------------------------------------------------------ - -namespace HuffmanVisualization.Properties -{ - - - /// - /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. - /// - // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder - // класс с помощью таких средств, как ResGen или Visual Studio. - // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen - // с параметром /str или заново постройте свой VS-проект. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HuffmanVisualization.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Переопределяет свойство CurrentUICulture текущего потока для всех - /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/Resources.resx b/HuffmanVisualization/HuffmanVisualization/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/HuffmanVisualization/HuffmanVisualization/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/Settings.Designer.cs b/HuffmanVisualization/HuffmanVisualization/Properties/Settings.Designer.cs deleted file mode 100644 index 0b7b424..0000000 --- a/HuffmanVisualization/HuffmanVisualization/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace HuffmanVisualization.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/HuffmanVisualization/HuffmanVisualization/Properties/Settings.settings b/HuffmanVisualization/HuffmanVisualization/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/HuffmanVisualization/HuffmanVisualization/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Laba4aisd/Laba4aisd.sln b/Laba4aisd/Laba4aisd.sln deleted file mode 100644 index a571efb..0000000 --- a/Laba4aisd/Laba4aisd.sln +++ /dev/null @@ -1,51 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Laba4aisd", "Laba4aisd\Laba4aisd.vcxproj", "{035BDD56-BF4E-44C8-A59B-E021E4940416}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zadanie22", "zadanie22\zadanie22.vcxproj", "{EE038EDC-74BB-414C-B90E-D7C793F72FB0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zadanie11", "zadanie11\zadanie11.vcxproj", "{AEC64E83-FB0D-473B-9C55-2380CD92ABA4}" -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 - {035BDD56-BF4E-44C8-A59B-E021E4940416}.Debug|x64.ActiveCfg = Debug|x64 - {035BDD56-BF4E-44C8-A59B-E021E4940416}.Debug|x64.Build.0 = Debug|x64 - {035BDD56-BF4E-44C8-A59B-E021E4940416}.Debug|x86.ActiveCfg = Debug|Win32 - {035BDD56-BF4E-44C8-A59B-E021E4940416}.Debug|x86.Build.0 = Debug|Win32 - {035BDD56-BF4E-44C8-A59B-E021E4940416}.Release|x64.ActiveCfg = Release|x64 - {035BDD56-BF4E-44C8-A59B-E021E4940416}.Release|x64.Build.0 = Release|x64 - {035BDD56-BF4E-44C8-A59B-E021E4940416}.Release|x86.ActiveCfg = Release|Win32 - {035BDD56-BF4E-44C8-A59B-E021E4940416}.Release|x86.Build.0 = Release|Win32 - {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Debug|x64.ActiveCfg = Debug|x64 - {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Debug|x64.Build.0 = Debug|x64 - {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Debug|x86.ActiveCfg = Debug|Win32 - {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Debug|x86.Build.0 = Debug|Win32 - {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Release|x64.ActiveCfg = Release|x64 - {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Release|x64.Build.0 = Release|x64 - {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Release|x86.ActiveCfg = Release|Win32 - {EE038EDC-74BB-414C-B90E-D7C793F72FB0}.Release|x86.Build.0 = Release|Win32 - {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Debug|x64.ActiveCfg = Debug|x64 - {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Debug|x64.Build.0 = Debug|x64 - {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Debug|x86.ActiveCfg = Debug|Win32 - {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Debug|x86.Build.0 = Debug|Win32 - {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Release|x64.ActiveCfg = Release|x64 - {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Release|x64.Build.0 = Release|x64 - {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Release|x86.ActiveCfg = Release|Win32 - {AEC64E83-FB0D-473B-9C55-2380CD92ABA4}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {FE66B116-6EAA-4846-B756-4525B5D097A4} - EndGlobalSection -EndGlobal diff --git a/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj b/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj deleted file mode 100644 index d776bf2..0000000 --- a/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {035bdd56-bf4e-44c8-a59b-e021e4940416} - Laba4aisd - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - \ No newline at end of file diff --git a/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters b/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters deleted file mode 100644 index 153170c..0000000 --- a/Laba4aisd/Laba4aisd/Laba4aisd.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/Laba4aisd/zadanie11/zadanie11.cpp b/Laba4aisd/zadanie11/zadanie11.cpp deleted file mode 100644 index f78230c..0000000 --- a/Laba4aisd/zadanie11/zadanie11.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include - -class HashTable { -private: - static const int TABLE_SIZE = 11; - std::vector> table[TABLE_SIZE]; - - int hashFunction1(const std::string& key) { - int hash = 0; - for (char c : key) { - hash = (hash * 31 + c) % TABLE_SIZE; - } - return hash; - } - - int hashFunction2(const std::string& key) { - int hash = 0; - for (char c : key) { - hash = (hash * 17 + c) % (TABLE_SIZE - 1) + 1; - } - return hash; - } - -public: - void insert(const std::string& key, int value) { - int index = hashFunction1(key); - int offset = hashFunction2(key); - - while (!table[index].empty() && table[index].back().first != key) { - index = (index + offset) % TABLE_SIZE; - } - - table[index].push_back(std::make_pair(key, value)); - } - - int search(const std::string& key) { - int index = hashFunction1(key); - int offset = hashFunction2(key); - - while (!table[index].empty() && table[index].back().first != key) { - index = (index + offset) % TABLE_SIZE; - } - - if (!table[index].empty() && table[index].back().first == key) { - return table[index].back().second; - } - else { - return -1; // ключ не найден - } - } -}; - -int main() { - HashTable ht; - - ht.insert("Alice", 30); - ht.insert("Bob", 40); - - std::cout << "Значение для ключа 'Alice': " << ht.search("Alice") << std::endl; - std::cout << "Значение для ключа 'Bob': " << ht.search("Bob") << std::endl; - - return 0; -} \ No newline at end of file diff --git a/Laba4aisd/zadanie11/zadanie11.vcxproj b/Laba4aisd/zadanie11/zadanie11.vcxproj deleted file mode 100644 index 97614bb..0000000 --- a/Laba4aisd/zadanie11/zadanie11.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {aec64e83-fb0d-473b-9c55-2380cd92aba4} - zadanie11 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/Laba4aisd/zadanie11/zadanie11.vcxproj.filters b/Laba4aisd/zadanie11/zadanie11.vcxproj.filters deleted file mode 100644 index f25d897..0000000 --- a/Laba4aisd/zadanie11/zadanie11.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/Laba4aisd/zadanie2/zadanie2.vcxproj b/Laba4aisd/zadanie2/zadanie2.vcxproj deleted file mode 100644 index 79237a1..0000000 --- a/Laba4aisd/zadanie2/zadanie2.vcxproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - - 17.0 - Win32Proj - {3cc79c84-69a5-46a8-9e46-b0ab71bb954a} - zadanie2 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - diff --git a/Laba4aisd/zadanie2/zadanie2.vcxproj.filters b/Laba4aisd/zadanie2/zadanie2.vcxproj.filters deleted file mode 100644 index 153170c..0000000 --- a/Laba4aisd/zadanie2/zadanie2.vcxproj.filters +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - \ No newline at end of file diff --git a/Laba4aisd/zadanie22/zadanie22.cpp b/Laba4aisd/zadanie22/zadanie22.cpp deleted file mode 100644 index 5f28270..0000000 --- a/Laba4aisd/zadanie22/zadanie22.cpp +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Laba4aisd/zadanie22/zadanie22.vcxproj b/Laba4aisd/zadanie22/zadanie22.vcxproj deleted file mode 100644 index 9b5e878..0000000 --- a/Laba4aisd/zadanie22/zadanie22.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {ee038edc-74bb-414c-b90e-d7c793f72fb0} - zadanie22 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/Laba4aisd/zadanie22/zadanie22.vcxproj.filters b/Laba4aisd/zadanie22/zadanie22.vcxproj.filters deleted file mode 100644 index 780f3c0..0000000 --- a/Laba4aisd/zadanie22/zadanie22.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/labalaba2/lab2/SourceZhadny.cpp b/labalaba2/lab2/SourceZhadny.cpp deleted file mode 100644 index cf22f5b..0000000 --- a/labalaba2/lab2/SourceZhadny.cpp +++ /dev/null @@ -1,135 +0,0 @@ -#include -#include -#include -class Item { -private: - std::string name; - int weight; - int price; -public: - - int GetItemWeight() { - return weight; - } - int GetItemPrice() { - return price; - } - double GetPriceOfWeight() { - return price / (double)weight; - } - void PrintParametres() { - std::cout << "\tName item: " << name << "\n\t\tWeight: " << weight << "\n\t\tPrice:" << price << std::endl; - } - void SetParametresOfItem() { - std::cout << "Enter name of item: "; - std::cin >> name; - std::cout << std::endl; - std::cout << "Enter weight of item: "; - std::cin >> weight; - std::cout << std::endl; - std::cout << "Enter price of item: "; - std::cin >> price; - std::cout << std::endl; - } -}; - -class ItemsHeap { -private: - bool sorted = false; - std::vector itemsHeap; - void m_swap(int i_1, int i_2) { - Item tmp = itemsHeap[i_1]; - itemsHeap[i_1] = itemsHeap[i_2]; - itemsHeap[i_2] = tmp; - } - void sort_items() { - int i_mx = 0; - for (int i = 0; i < itemsHeap.size(); ++i) { - i_mx = i; - for (int j = i + 1; j < itemsHeap.size(); ++j) { - if (itemsHeap[j].GetPriceOfWeight() > itemsHeap[i_mx].GetPriceOfWeight()) { - i_mx = j; - } - } - if (i != i_mx) - m_swap(i, i_mx); - } - } -public: - int GetSizeHeap() { - return itemsHeap.size(); - } - void AddItemInHeap() { - Item newItem; - newItem.SetParametresOfItem(); - itemsHeap.push_back(newItem); - } - Item getItem() { - if (!sorted) { - sort_items(); - sorted = true; - } - Item temp = itemsHeap[0]; - itemsHeap.erase(itemsHeap.begin()); - return temp; - } -}; - -class Knapsack { -private: - int max_weight; - int weight = 0; - int price = 0; - ItemsHeap heap; - std::vector items; - void SumOfItems(Item temp) { - price += temp.GetItemPrice(); - } - void WeightOfItems(Item temp) { - weight += temp.GetItemWeight(); - } -public: - int GetSizeOfHeapOnFloor() { - return heap.GetSizeHeap(); - } - void SetMaxWeight() { - std::cout << "Enter max weight: "; - std::cin >> max_weight; - std::cout << std::endl; - } - void PrintItems() { - std::cout << "Items:\n"; - for (int i = 0; i < items.size(); ++i) { - items[i].PrintParametres(); - } - } - void PrintParametresKnapsack() { - std::cout << "Backpack parametres:\n" << "\tPrice: " << price << " " << "\n\tWeight: " << weight << " " << "\n\tMax weight: " << max_weight << std::endl; - PrintItems(); - } - void AddItemOnFloor() { - heap.AddItemInHeap(); - } - void AddItemInKnapsack() { - while (heap.GetSizeHeap() > 0) { - Item temp = heap.getItem(); - if (temp.GetItemWeight() + weight <= max_weight) - { - items.push_back(temp); - SumOfItems(temp); - WeightOfItems(temp); - } - else - break; - } - std::cout << "Complete task" << std::endl; - } -}; - -void main() { - Knapsack backpack; - backpack.SetMaxWeight(); - backpack.AddItemOnFloor(); - backpack.AddItemInKnapsack(); - backpack.PrintParametresKnapsack(); -} \ No newline at end of file diff --git a/labalaba2/lab2/lab2.vcxproj b/labalaba2/lab2/lab2.vcxproj deleted file mode 100644 index d5d79ac..0000000 --- a/labalaba2/lab2/lab2.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {94371f76-b2cc-4212-8f44-31c220e94e22} - lab2 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/labalaba2/lab2/lab2.vcxproj.filters b/labalaba2/lab2/lab2.vcxproj.filters deleted file mode 100644 index 01dcf8d..0000000 --- a/labalaba2/lab2/lab2.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/labalaba2/lab2z3/Zadanie3.cpp b/labalaba2/lab2z3/Zadanie3.cpp deleted file mode 100644 index de4a8d8..0000000 --- a/labalaba2/lab2z3/Zadanie3.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include - - -void m_swap(int* arr, int i_1, int i_2) { - int tmp = arr[i_1]; - arr[i_1] = arr[i_2]; - arr[i_2] = tmp; -} -int fib(int n) { //O(2**n) - if (n < 2) - return 1; - return fib(n - 1) + fib(n - 2); -} - -void sort_choice(int arr[], int size) { //n*n - int i_mn = 0; - for (int i = 0; i < size; ++i) { - i_mn = i; - for (int j = i + 1; j < size; ++j) { - if (arr[j] < arr[i_mn]) { - i_mn = j; - } - } - if (i != i_mn) - m_swap(arr, i, i_mn); - } -} - - -void quickSort(int* arr, int left, int right) //n logN -{ - int piv; - int index; - int _left = left; - int _right = right; - piv = arr[left]; - while (left < right) - { - while ((arr[right] > piv) && (left < right)) - right--; - if (left != right) - { - arr[left] = arr[right]; - left++; - } - while ((arr[left] < piv) && (left < right)) - left++; - if (left != right) - { - arr[right] = arr[left]; - right--; - } - } - arr[left] = piv; - index = left; - left = _left; - right = _right; - if (left < index) - quickSort(arr, left, index - 1); - if (right > index) - quickSort(arr, index + 1, right); -} - diff --git a/labalaba2/lab2z3/lab2z3.vcxproj b/labalaba2/lab2z3/lab2z3.vcxproj deleted file mode 100644 index d6b7dd8..0000000 --- a/labalaba2/lab2z3/lab2z3.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {5e968207-3ace-4f80-968b-65cd0841b6de} - lab2z3 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/labalaba2/lab2z3/lab2z3.vcxproj.filters b/labalaba2/lab2z3/lab2z3.vcxproj.filters deleted file mode 100644 index b691508..0000000 --- a/labalaba2/lab2z3/lab2z3.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/labalaba2/labalaba2.sln b/labalaba2/labalaba2.sln deleted file mode 100644 index 726c7c0..0000000 --- a/labalaba2/labalaba2.sln +++ /dev/null @@ -1,51 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "labalaba2", "labalaba2\labalaba2.vcxproj", "{78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab2", "lab2\lab2.vcxproj", "{94371F76-B2CC-4212-8F44-31C220E94E22}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab2z3", "lab2z3\lab2z3.vcxproj", "{5E968207-3ACE-4F80-968B-65CD0841B6DE}" -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 - {78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}.Debug|x64.ActiveCfg = Debug|x64 - {78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}.Debug|x64.Build.0 = Debug|x64 - {78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}.Debug|x86.ActiveCfg = Debug|Win32 - {78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}.Debug|x86.Build.0 = Debug|Win32 - {78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}.Release|x64.ActiveCfg = Release|x64 - {78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}.Release|x64.Build.0 = Release|x64 - {78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}.Release|x86.ActiveCfg = Release|Win32 - {78A2C6D7-BAB1-4CE3-B6B6-B52B3BDCBE5E}.Release|x86.Build.0 = Release|Win32 - {94371F76-B2CC-4212-8F44-31C220E94E22}.Debug|x64.ActiveCfg = Debug|x64 - {94371F76-B2CC-4212-8F44-31C220E94E22}.Debug|x64.Build.0 = Debug|x64 - {94371F76-B2CC-4212-8F44-31C220E94E22}.Debug|x86.ActiveCfg = Debug|Win32 - {94371F76-B2CC-4212-8F44-31C220E94E22}.Debug|x86.Build.0 = Debug|Win32 - {94371F76-B2CC-4212-8F44-31C220E94E22}.Release|x64.ActiveCfg = Release|x64 - {94371F76-B2CC-4212-8F44-31C220E94E22}.Release|x64.Build.0 = Release|x64 - {94371F76-B2CC-4212-8F44-31C220E94E22}.Release|x86.ActiveCfg = Release|Win32 - {94371F76-B2CC-4212-8F44-31C220E94E22}.Release|x86.Build.0 = Release|Win32 - {5E968207-3ACE-4F80-968B-65CD0841B6DE}.Debug|x64.ActiveCfg = Debug|x64 - {5E968207-3ACE-4F80-968B-65CD0841B6DE}.Debug|x64.Build.0 = Debug|x64 - {5E968207-3ACE-4F80-968B-65CD0841B6DE}.Debug|x86.ActiveCfg = Debug|Win32 - {5E968207-3ACE-4F80-968B-65CD0841B6DE}.Debug|x86.Build.0 = Debug|Win32 - {5E968207-3ACE-4F80-968B-65CD0841B6DE}.Release|x64.ActiveCfg = Release|x64 - {5E968207-3ACE-4F80-968B-65CD0841B6DE}.Release|x64.Build.0 = Release|x64 - {5E968207-3ACE-4F80-968B-65CD0841B6DE}.Release|x86.ActiveCfg = Release|Win32 - {5E968207-3ACE-4F80-968B-65CD0841B6DE}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {2B4A490B-BC2E-4EA7-B0EA-55C5328D08A6} - EndGlobalSection -EndGlobal diff --git a/labalaba2/labalaba2/SourceDinam.cpp b/labalaba2/labalaba2/SourceDinam.cpp deleted file mode 100644 index 4dd21dd..0000000 --- a/labalaba2/labalaba2/SourceDinam.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include -#include -#include - - -class Item { -private: - std::string name; - int weight; - int price; -public: - int GetItemWeight() { - return weight; - } - int GetItemPrice() { - return price; - } - double GetPriceOfWeight() { - return price / (double)weight; - } - void PrintParametres() { - std::cout << "\tName item: " << name << "\n\tWeight: " << weight << "\n\tPrice:" << price << std::endl; - } - void SetParametresOfItem() { - std::cout << "Enter name of item: "; - std::cin >> name; - std::cout << std::endl; - std::cout << "Enter weight of item: "; - std::cin >> weight; - std::cout << std::endl; - std::cout << "Enter price of item: "; - std::cin >> price; - std::cout << std::endl; - } -}; - -class ItemsHeap { -private: - std::vector itemsHeap; -public: - int GetSizeHeap() { - return itemsHeap.size(); - } - void AddItemInHeap() { - Item newItem; - newItem.SetParametresOfItem(); - itemsHeap.push_back(newItem); - } - Item getItem(int i) { - return itemsHeap[i]; - } -}; -class Knapsack { -private: - int max_weight; - int weight = 0; - int price = 0; - ItemsHeap heap; - std::vector items; - - void SumOfItems(Item temp) { - price += temp.GetItemPrice(); - } - void WeightOfItems(Item temp) { - weight += temp.GetItemWeight(); - } - void PushItem(Item temp) { - items.push_back(temp); - SumOfItems(temp); - WeightOfItems(temp); - } - void PrintItems() { - std::cout << "Items:\n"; - for (int i = 0; i < items.size(); ++i) { - items[i].PrintParametres(); - } - } -public: - int GetPiceOfKnapsack() { - return price; - } - int GetSizeOfHeapOnFloor() { - return heap.GetSizeHeap(); - } - void SetMaxWeight() { - std::cout << "Enter max weight: "; - std::cin >> max_weight; - std::cout << std::endl; - } - void PrintParametresKnapsack() { - std::cout << "Backpack parametres:\n" << "\tPrice: " << price << " " << "\n\tWeight: " << weight << " " << "\n\tMax weight: " << max_weight << std::endl; - PrintItems(); - } - void AddItemOnFloor() { - heap.AddItemInHeap(); - } - void AddItemInKnapsack() { - if (heap.GetSizeHeap() > 1) { - Knapsack** kp = new Knapsack * [heap.GetSizeHeap() + 1]; - Knapsack temp, temp2; - int max_price = 0, i_mx = 0, j_mx = 0; - for (int i = 0; i < max_weight; ++i) { - kp[i] = new Knapsack[max_weight + 1]; - } - for (int i = 0; i < heap.GetSizeHeap() + 1; ++i) { - for (int j = 0; j < max_weight + 1; ++j) { - if (i == 0 || j == 0) - { - kp[i][j] = temp; - } - else if (i == 1) { - if (heap.getItem(0).GetItemWeight() <= j) - kp[1][j].PushItem(heap.getItem(0)); - else - kp[1][j] = temp; - } - else - { - if (heap.getItem(i - 1).GetItemWeight() > j) - kp[i][j] = kp[i - 1][j]; - else - { - int newPrice = heap.getItem(i - 1).GetItemPrice() + kp[i - 1][j - heap.getItem(i - 1).GetItemWeight()].GetPiceOfKnapsack(); - if (kp[i - 1][j].GetPiceOfKnapsack() > newPrice) - kp[i][j] = kp[i - 1][j]; - else - { - kp[i][j] = kp[i - 1][j - heap.getItem(i - 1).GetItemWeight()]; - kp[i][j].PushItem(heap.getItem(i - 1)); - temp2 = kp[i][j]; - } - } - } - } - } - for (int i = 0; i < temp2.items.size(); ++i) { - PushItem(temp2.items[i]); - } - std::cout << "Complete task" << std::endl; - } - else { - PushItem(heap.getItem(0)); - } - } -}; - -void main() { - Knapsack backpack; - backpack.SetMaxWeight(); - backpack.AddItemOnFloor(); - backpack.AddItemOnFloor(); - backpack.AddItemInKnapsack(); - backpack.PrintParametresKnapsack(); -} \ No newline at end of file diff --git a/labalaba2/labalaba2/labalaba2.vcxproj b/labalaba2/labalaba2/labalaba2.vcxproj deleted file mode 100644 index 59521ad..0000000 --- a/labalaba2/labalaba2/labalaba2.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {78a2c6d7-bab1-4ce3-b6b6-b52b3bdcbe5e} - labalaba2 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/labalaba2/labalaba2/labalaba2.vcxproj.filters b/labalaba2/labalaba2/labalaba2.vcxproj.filters deleted file mode 100644 index bd31792..0000000 --- a/labalaba2/labalaba2/labalaba2.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/labalaba3/labalaba3.sln b/labalaba3/labalaba3.sln deleted file mode 100644 index 00b34bf..0000000 --- a/labalaba3/labalaba3.sln +++ /dev/null @@ -1,51 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "labalaba3", "labalaba3\labalaba3.vcxproj", "{BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lll", "lll\lll.vcxproj", "{EB92EF71-83FC-4188-9F00-2585E05A4899}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llll", "llll\llll.vcxproj", "{79F0852A-46F9-4575-999C-013A7DDDCC2D}" -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 - {BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}.Debug|x64.ActiveCfg = Debug|x64 - {BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}.Debug|x64.Build.0 = Debug|x64 - {BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}.Debug|x86.ActiveCfg = Debug|Win32 - {BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}.Debug|x86.Build.0 = Debug|Win32 - {BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}.Release|x64.ActiveCfg = Release|x64 - {BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}.Release|x64.Build.0 = Release|x64 - {BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}.Release|x86.ActiveCfg = Release|Win32 - {BBEBBE45-49A2-41F6-A798-1FFD74A6A9B1}.Release|x86.Build.0 = Release|Win32 - {EB92EF71-83FC-4188-9F00-2585E05A4899}.Debug|x64.ActiveCfg = Debug|x64 - {EB92EF71-83FC-4188-9F00-2585E05A4899}.Debug|x64.Build.0 = Debug|x64 - {EB92EF71-83FC-4188-9F00-2585E05A4899}.Debug|x86.ActiveCfg = Debug|Win32 - {EB92EF71-83FC-4188-9F00-2585E05A4899}.Debug|x86.Build.0 = Debug|Win32 - {EB92EF71-83FC-4188-9F00-2585E05A4899}.Release|x64.ActiveCfg = Release|x64 - {EB92EF71-83FC-4188-9F00-2585E05A4899}.Release|x64.Build.0 = Release|x64 - {EB92EF71-83FC-4188-9F00-2585E05A4899}.Release|x86.ActiveCfg = Release|Win32 - {EB92EF71-83FC-4188-9F00-2585E05A4899}.Release|x86.Build.0 = Release|Win32 - {79F0852A-46F9-4575-999C-013A7DDDCC2D}.Debug|x64.ActiveCfg = Debug|x64 - {79F0852A-46F9-4575-999C-013A7DDDCC2D}.Debug|x64.Build.0 = Debug|x64 - {79F0852A-46F9-4575-999C-013A7DDDCC2D}.Debug|x86.ActiveCfg = Debug|Win32 - {79F0852A-46F9-4575-999C-013A7DDDCC2D}.Debug|x86.Build.0 = Debug|Win32 - {79F0852A-46F9-4575-999C-013A7DDDCC2D}.Release|x64.ActiveCfg = Release|x64 - {79F0852A-46F9-4575-999C-013A7DDDCC2D}.Release|x64.Build.0 = Release|x64 - {79F0852A-46F9-4575-999C-013A7DDDCC2D}.Release|x86.ActiveCfg = Release|Win32 - {79F0852A-46F9-4575-999C-013A7DDDCC2D}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {BDC6D94C-5D3D-4E1A-B136-03128DB2565F} - EndGlobalSection -EndGlobal diff --git a/labalaba3/labalaba3/labalaba3.vcxproj b/labalaba3/labalaba3/labalaba3.vcxproj deleted file mode 100644 index 237d2e7..0000000 --- a/labalaba3/labalaba3/labalaba3.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {bbebbe45-49a2-41f6-a798-1ffd74a6a9b1} - labalaba3 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/labalaba3/labalaba3/labalaba3.vcxproj.filters b/labalaba3/labalaba3/labalaba3.vcxproj.filters deleted file mode 100644 index ff7636d..0000000 --- a/labalaba3/labalaba3/labalaba3.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/labalaba3/labalaba3/zadanie1.cpp b/labalaba3/labalaba3/zadanie1.cpp deleted file mode 100644 index 0de224d..0000000 --- a/labalaba3/labalaba3/zadanie1.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#include - -class HashTable { -private: - static const int TABLE_SIZE = 11; - std::vector> table[TABLE_SIZE]; - - int hashFunction1(const std::string& key) { - int hash = 0; - for (char c : key) { - hash = (hash * 31 + c) % TABLE_SIZE; - } - return hash; - } - - int hashFunction2(const std::string& key) { - int hash = 0; - for (char c : key) { - hash = (hash * 17 + c) % (TABLE_SIZE - 1) + 1; - } - return hash; - } - -public: - void insert(const std::string& key, int value) { - int index = hashFunction1(key); - int offset = hashFunction2(key); - while (!table[index].empty() && table[index].back().first != key) { - index = (index + offset) % TABLE_SIZE; - } - table[index].push_back(std::make_pair(key, value)); - } - - int search(const std::string& key) { - int index = hashFunction1(key); - int offset = hashFunction2(key); - while (!table[index].empty() && table[index].back().first != key) { - index = (index + offset) % TABLE_SIZE; - } - return table[index].empty() ? -1 : table[index].back().second; - } -}; - -int main() { - HashTable ht; - ht.insert("Alice", 30); - ht.insert("Bob", 40); - std::cout << ht.search("Alice") << " " << ht.search("Bob") << std::endl; - return 0; -} \ No newline at end of file diff --git a/labalaba3/lll/lll.vcxproj b/labalaba3/lll/lll.vcxproj deleted file mode 100644 index d2e5f7c..0000000 --- a/labalaba3/lll/lll.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {eb92ef71-83fc-4188-9f00-2585e05a4899} - lll - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/labalaba3/lll/lll.vcxproj.filters b/labalaba3/lll/lll.vcxproj.filters deleted file mode 100644 index e53a161..0000000 --- a/labalaba3/lll/lll.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/labalaba3/lll/zadanie2.cpp b/labalaba3/lll/zadanie2.cpp deleted file mode 100644 index 42fd391..0000000 --- a/labalaba3/lll/zadanie2.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include -#include -#include - -class HashTable { -private: - static const int TABLE_SIZE = 10; - std::vector>> table; - - int hashFunction(const std::string& key) { - int hash = 0; - for (char c : key) { - hash = (hash * 31 + c) % TABLE_SIZE; - } - return hash; - } - -public: - HashTable() : table(TABLE_SIZE) {} - - void insert(const std::string& key, int value) { - int index = hashFunction(key); - table[index].push_back(std::make_pair(key, value)); - } - - int search(const std::string& key) { - int index = hashFunction(key); - for (const auto& pair : table[index]) { - if (pair.first == key) { - return pair.second; // найдено значение - } - } - return -1; // значение не найдено - } -}; - -int main() { - HashTable ht; - - ht.insert("Alice", 30); - ht.insert("Bob", 40); - - std::cout << "Значение для ключа 'Alice': " << ht.search("Alice") << std::endl; - std::cout << "Значение для ключа 'Bob': " << ht.search("Bob") << std::endl; - - return 0; -} \ No newline at end of file diff --git a/labalaba3/llll/llll.vcxproj b/labalaba3/llll/llll.vcxproj deleted file mode 100644 index a3666cb..0000000 --- a/labalaba3/llll/llll.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {79f0852a-46f9-4575-999c-013a7dddcc2d} - llll - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/labalaba3/llll/llll.vcxproj.filters b/labalaba3/llll/llll.vcxproj.filters deleted file mode 100644 index caab71f..0000000 --- a/labalaba3/llll/llll.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/labalaba3/llll/zadanie3.cpp b/labalaba3/llll/zadanie3.cpp deleted file mode 100644 index 2faf57c..0000000 --- a/labalaba3/llll/zadanie3.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include -using namespace std; -struct M { string t; int y; double r; }; -struct N { M m; N* n; N(M m) :m(m), n(nullptr) {} }; -class D { -N* f, * r; public:D() :f(nullptr), r(nullptr) {} - void i(M m) { N* n = new N(m); if (!f)f = r = n; else { n->n = f; f = n; } } - void a(M m) { N* n = new N(m); if (!f)f = r = n; else { r->n = n; r = n; } } - void rf() { if (f) { N* t = f; f = f->n; delete t; if (!f)r = nullptr; } } - void rr() { if (f) { if (f == r) { delete f; f = r = nullptr; } else { N* t = f; while (t->n != r)t = t->n; delete r; r = t; r->n = nullptr; } } } - M gf() { return f->m; } - M gr() { return r->m; } -}; -void b(vector& m) { int n = m.size(); for (int i = 0; i < n - 1; ++i)for (int j = 0; j < n - i - 1; ++j)if (m[j].r > m[j + 1].r)swap(m[j], m[j + 1]); } -int p(vector& m, int l, int h) { double p = m[h].r; int i = l - 1; for (int j = l; j <= h - 1; ++j)if (m[j].r < p) { ++i; swap(m[i], m[j]); }swap(m[i + 1], m[h]); return i + 1; } -void q(vector& m, int l, int h) { if (l < h) { int pi = p(m, l, h); q(m, l, pi - 1); q(m, pi + 1, h); } } -int main() { - D d; - d.i({ "M1",2000,8.5 }); - d.a({ "M2",2005,9.0 }); - d.i({ "M3",2010,7.8 }); - vector m = { {"MA",2002,8.2}, {"MB",2008,7.5}, {"MC",2015,9.1}, {"MD",2018,8.7} }; - b(m); - for (M& e : m) - cout << e.t << " " << e.y << " " << e.r << endl; - q(m, 0, m.size() - 1); - for (M& e : m) - cout << e.t << " " << e.y << " " << e.r << endl; - return 0; -} \ No newline at end of file diff --git a/labalaba3/zad4/zad4.cpp b/labalaba3/zad4/zad4.cpp deleted file mode 100644 index 769fb9f..0000000 --- a/labalaba3/zad4/zad4.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// zad4.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. -// - -#include - -int main() -{ - std::cout << "Hello World!\n"; -} - -// Запуск программы: CTRL+F5 или меню "Отладка" > "Запуск без отладки" -// Отладка программы: F5 или меню "Отладка" > "Запустить отладку" - -// Советы по началу работы -// 1. В окне обозревателя решений можно добавлять файлы и управлять ими. -// 2. В окне Team Explorer можно подключиться к системе управления версиями. -// 3. В окне "Выходные данные" можно просматривать выходные данные сборки и другие сообщения. -// 4. В окне "Список ошибок" можно просматривать ошибки. -// 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода. -// 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл. diff --git a/labalaba3/zad4/zad4.vcxproj b/labalaba3/zad4/zad4.vcxproj deleted file mode 100644 index e540384..0000000 --- a/labalaba3/zad4/zad4.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {78672faf-3e00-428c-bb07-f993a1958574} - zad4 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/labalaba3/zad4/zad4.vcxproj.filters b/labalaba3/zad4/zad4.vcxproj.filters deleted file mode 100644 index d77f914..0000000 --- a/labalaba3/zad4/zad4.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file -- 2.25.1 From 8503a819fdc41f0a6d85886056377b56201e461b Mon Sep 17 00:00:00 2001 From: elizaveta Date: Thu, 13 Jun 2024 02:53:12 +0400 Subject: [PATCH 3/3] lab5 --- Tank/Tank/Entities/EntityMachine.cs | 2 +- Tank/Tank/Entities/EntityTank.cs | 5 + Tank/Tank/FormTankCollection.Designer.cs | 2 +- Tank/Tank/FormTankCollection.cs | 65 +---- Tank/Tank/FormTankConfig.Designer.cs | 357 +++++++++++++++++++++++ Tank/Tank/FormTankConfig.cs | 139 +++++++++ Tank/Tank/FormTankConfig.resx | 120 ++++++++ 7 files changed, 639 insertions(+), 51 deletions(-) create mode 100644 Tank/Tank/FormTankConfig.Designer.cs create mode 100644 Tank/Tank/FormTankConfig.cs create mode 100644 Tank/Tank/FormTankConfig.resx diff --git a/Tank/Tank/Entities/EntityMachine.cs b/Tank/Tank/Entities/EntityMachine.cs index 011107c..0f50398 100644 --- a/Tank/Tank/Entities/EntityMachine.cs +++ b/Tank/Tank/Entities/EntityMachine.cs @@ -39,6 +39,6 @@ public class EntityMachine internal void SetBodyColor(Color color) { - throw new NotImplementedException(); + BodyColor = color; } } diff --git a/Tank/Tank/Entities/EntityTank.cs b/Tank/Tank/Entities/EntityTank.cs index 7d98f61..5ed0f6a 100644 --- a/Tank/Tank/Entities/EntityTank.cs +++ b/Tank/Tank/Entities/EntityTank.cs @@ -33,4 +33,9 @@ public class EntityTank : EntityMachine Pulemet = pulemet; } + + public void SetAdditional(Color color) + { + AdditionalColor = color; + } } \ No newline at end of file diff --git a/Tank/Tank/FormTankCollection.Designer.cs b/Tank/Tank/FormTankCollection.Designer.cs index d379dff..c832fe2 100644 --- a/Tank/Tank/FormTankCollection.Designer.cs +++ b/Tank/Tank/FormTankCollection.Designer.cs @@ -90,7 +90,7 @@ buttonAddTank.TabIndex = 1; buttonAddTank.Text = "Добавление танка"; buttonAddTank.UseVisualStyleBackColor = true; - + buttonAddTank.Click += buttonAddTank_Click; // // maskedTextBoxPosition // diff --git a/Tank/Tank/FormTankCollection.cs b/Tank/Tank/FormTankCollection.cs index 8763c0e..e57003a 100644 --- a/Tank/Tank/FormTankCollection.cs +++ b/Tank/Tank/FormTankCollection.cs @@ -42,45 +42,17 @@ public partial class FormTankCollection : Form { panelCompanyTools.Enabled = false; } - - /// - /// Добавление обычного автомобиля - /// - /// - /// - private void ButtonAddMachine_Click(object sender, EventArgs e) => CreateObject(nameof(DrawningMachine)); + /// ///Создание объекта класса-перемещения /// /// Тип создаваемого объётека - private void CreateObject(string type) + private void SetMachine(DrawningMachine machine) { - if (_company == null) - { - return; - } - - Random rnd = new Random(); - DrawningMachine drawningMachine; - switch (type) - { - case nameof(DrawningMachine): - drawningMachine = new DrawningMachine(rnd.Next(100, 300), rnd.Next(1000, 3000), GetColor(rnd)); - break; - case nameof(DrawningTank): - drawningMachine = new DrawningTank(rnd.Next(650, 700), rnd.Next(15760, 16130), - GetColor(rnd), - GetColor(rnd), - Convert.ToBoolean(rnd.Next(0, 2)), - Convert.ToBoolean(rnd.Next(0, 2))); - break; - default: - return; - } - - if (_company + drawningMachine != -1) + if (_company == null || machine == null) return; + if (_company + machine != -1) { MessageBox.Show("Объект добавлен"); pictureBox.Image = _company.Show(); @@ -91,23 +63,6 @@ public partial class FormTankCollection : Form } } - /// - /// Получение цвета - /// - /// Генератор случайных чисел - /// - private static Color GetColor(Random random) - { - Color color = Color.FromArgb(random.Next(0, 256), random.Next(0, - 256), random.Next(0, 256)); - ColorDialog dialog = new(); - if (dialog.ShowDialog() == DialogResult.OK) - { - color = dialog.Color; - } - return color; - } - /// /// Удаление объекта /// @@ -263,4 +218,16 @@ public partial class FormTankCollection : Form { } + + /// + /// + /// + /// + /// + private void buttonAddTank_Click(object sender, EventArgs e) + { + FormTankConfig form = new(); + form.Show(); + form.AddEvent(SetMachine); + } } \ No newline at end of file diff --git a/Tank/Tank/FormTankConfig.Designer.cs b/Tank/Tank/FormTankConfig.Designer.cs new file mode 100644 index 0000000..46a4730 --- /dev/null +++ b/Tank/Tank/FormTankConfig.Designer.cs @@ -0,0 +1,357 @@ +namespace Tank +{ + partial class FormTankConfig + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + groupBoxConfig = new GroupBox(); + groupBoxColors = new GroupBox(); + panelPurple = new Panel(); + panelBlack = new Panel(); + panelGray = new Panel(); + panelWhite = new Panel(); + panelYellow = new Panel(); + panelBlue = new Panel(); + panelGreen = new Panel(); + panelRed = new Panel(); + checkBoxPulemet = new CheckBox(); + checkBoxPushka = new CheckBox(); + numericUpDownWeight = new NumericUpDown(); + labelWeight = new Label(); + numericUpDownSpeed = new NumericUpDown(); + labelSpeed = new Label(); + labelModifiedObject = new Label(); + labelSimpleObject = new Label(); + pictureBoxObject = new PictureBox(); + buttonAdd = new Button(); + buttonCancel = new Button(); + panelObject = new Panel(); + labelAdditionalColor = new Label(); + labelBodyColor = new Label(); + groupBoxConfig.SuspendLayout(); + groupBoxColors.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)numericUpDownWeight).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).BeginInit(); + ((System.ComponentModel.ISupportInitialize)pictureBoxObject).BeginInit(); + panelObject.SuspendLayout(); + SuspendLayout(); + // + // groupBoxConfig + // + groupBoxConfig.Controls.Add(groupBoxColors); + groupBoxConfig.Controls.Add(checkBoxPulemet); + groupBoxConfig.Controls.Add(checkBoxPushka); + groupBoxConfig.Controls.Add(numericUpDownWeight); + groupBoxConfig.Controls.Add(labelWeight); + groupBoxConfig.Controls.Add(numericUpDownSpeed); + groupBoxConfig.Controls.Add(labelSpeed); + groupBoxConfig.Controls.Add(labelModifiedObject); + groupBoxConfig.Controls.Add(labelSimpleObject); + groupBoxConfig.Dock = DockStyle.Left; + groupBoxConfig.Location = new Point(0, 0); + groupBoxConfig.Name = "groupBoxConfig"; + groupBoxConfig.Size = new Size(891, 432); + groupBoxConfig.TabIndex = 0; + groupBoxConfig.TabStop = false; + groupBoxConfig.Text = "Параметры"; + // + // groupBoxColors + // + groupBoxColors.Controls.Add(panelPurple); + groupBoxColors.Controls.Add(panelBlack); + groupBoxColors.Controls.Add(panelGray); + groupBoxColors.Controls.Add(panelWhite); + groupBoxColors.Controls.Add(panelYellow); + groupBoxColors.Controls.Add(panelBlue); + groupBoxColors.Controls.Add(panelGreen); + groupBoxColors.Controls.Add(panelRed); + groupBoxColors.Location = new Point(385, 12); + groupBoxColors.Name = "groupBoxColors"; + groupBoxColors.Size = new Size(500, 249); + groupBoxColors.TabIndex = 8; + groupBoxColors.TabStop = false; + groupBoxColors.Text = "Цвета"; + // + // panelPurple + // + panelPurple.BackColor = Color.Purple; + panelPurple.Location = new Point(388, 151); + panelPurple.Name = "panelPurple"; + panelPurple.Size = new Size(70, 66); + panelPurple.TabIndex = 1; + // + // panelBlack + // + panelBlack.BackColor = Color.Black; + panelBlack.Location = new Point(274, 151); + panelBlack.Name = "panelBlack"; + panelBlack.Size = new Size(70, 66); + panelBlack.TabIndex = 1; + // + // panelGray + // + panelGray.BackColor = Color.Gray; + panelGray.Location = new Point(154, 151); + panelGray.Name = "panelGray"; + panelGray.Size = new Size(70, 66); + panelGray.TabIndex = 1; + // + // panelWhite + // + panelWhite.BackColor = Color.White; + panelWhite.Location = new Point(31, 151); + panelWhite.Name = "panelWhite"; + panelWhite.Size = new Size(70, 66); + panelWhite.TabIndex = 1; + // + // panelYellow + // + panelYellow.BackColor = Color.Yellow; + panelYellow.Location = new Point(388, 58); + panelYellow.Name = "panelYellow"; + panelYellow.Size = new Size(70, 66); + panelYellow.TabIndex = 1; + // + // panelBlue + // + panelBlue.BackColor = Color.Blue; + panelBlue.Location = new Point(274, 58); + panelBlue.Name = "panelBlue"; + panelBlue.Size = new Size(70, 66); + panelBlue.TabIndex = 1; + // + // panelGreen + // + panelGreen.BackColor = Color.Green; + panelGreen.Location = new Point(154, 58); + panelGreen.Name = "panelGreen"; + panelGreen.Size = new Size(70, 66); + panelGreen.TabIndex = 1; + // + // panelRed + // + panelRed.BackColor = Color.Red; + panelRed.Location = new Point(31, 58); + panelRed.Name = "panelRed"; + panelRed.Size = new Size(70, 66); + panelRed.TabIndex = 0; + // + // checkBoxPulemet + // + checkBoxPulemet.AutoSize = true; + checkBoxPulemet.Location = new Point(12, 225); + checkBoxPulemet.Name = "checkBoxPulemet"; + checkBoxPulemet.Size = new Size(351, 36); + checkBoxPulemet.TabIndex = 7; + checkBoxPulemet.Text = "Признак наличия пулемета"; + checkBoxPulemet.UseVisualStyleBackColor = true; + // + // checkBoxPushka + // + checkBoxPushka.AutoSize = true; + checkBoxPushka.Location = new Point(12, 163); + checkBoxPushka.Name = "checkBoxPushka"; + checkBoxPushka.Size = new Size(318, 36); + checkBoxPushka.TabIndex = 6; + checkBoxPushka.Text = "Признак наличия пушки"; + checkBoxPushka.UseVisualStyleBackColor = true; + // + // numericUpDownWeight + // + numericUpDownWeight.Location = new Point(139, 97); + numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); + numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 }); + numericUpDownWeight.Name = "numericUpDownWeight"; + numericUpDownWeight.Size = new Size(240, 39); + numericUpDownWeight.TabIndex = 5; + numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 }); + // + // labelWeight + // + labelWeight.AutoSize = true; + labelWeight.Location = new Point(12, 97); + labelWeight.Name = "labelWeight"; + labelWeight.Size = new Size(57, 32); + labelWeight.TabIndex = 4; + labelWeight.Text = "Вес:"; + // + // numericUpDownSpeed + // + numericUpDownSpeed.Location = new Point(139, 45); + numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); + numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 }); + numericUpDownSpeed.Name = "numericUpDownSpeed"; + numericUpDownSpeed.Size = new Size(240, 39); + numericUpDownSpeed.TabIndex = 3; + numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 }); + // + // labelSpeed + // + labelSpeed.AutoSize = true; + labelSpeed.Location = new Point(12, 45); + labelSpeed.Name = "labelSpeed"; + labelSpeed.Size = new Size(121, 32); + labelSpeed.TabIndex = 2; + labelSpeed.Text = "Скорость:"; + // + // labelModifiedObject + // + labelModifiedObject.BorderStyle = BorderStyle.FixedSingle; + labelModifiedObject.Location = new Point(659, 280); + labelModifiedObject.Name = "labelModifiedObject"; + labelModifiedObject.Size = new Size(184, 64); + labelModifiedObject.TabIndex = 1; + labelModifiedObject.Text = "Продвинутый"; + labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter; + labelModifiedObject.MouseDown += LabelObject_MouseDown; + // + // labelSimpleObject + // + labelSimpleObject.BorderStyle = BorderStyle.FixedSingle; + labelSimpleObject.Location = new Point(425, 280); + labelSimpleObject.Name = "labelSimpleObject"; + labelSimpleObject.Size = new Size(184, 64); + labelSimpleObject.TabIndex = 0; + labelSimpleObject.Text = "Простой"; + labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter; + labelSimpleObject.MouseDown += LabelObject_MouseDown; + // + // pictureBoxObject + // + pictureBoxObject.Location = new Point(3, 85); + pictureBoxObject.Name = "pictureBoxObject"; + pictureBoxObject.Size = new Size(319, 197); + pictureBoxObject.TabIndex = 1; + pictureBoxObject.TabStop = false; + // + // buttonAdd + // + buttonAdd.Location = new Point(897, 333); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(150, 46); + buttonAdd.TabIndex = 2; + buttonAdd.Text = "Добавить"; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // buttonCancel + // + buttonCancel.Location = new Point(1072, 333); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(150, 46); + buttonCancel.TabIndex = 3; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + // + // panelObject + // + panelObject.AllowDrop = true; + panelObject.Controls.Add(labelAdditionalColor); + panelObject.Controls.Add(labelBodyColor); + panelObject.Controls.Add(pictureBoxObject); + panelObject.Location = new Point(897, 12); + panelObject.Name = "panelObject"; + panelObject.Size = new Size(325, 297); + panelObject.TabIndex = 4; + panelObject.DragDrop += PanelObject_DragDrop; + panelObject.DragEnter += PanelObject_DragEnter; + // + // labelAdditionalColor + // + labelAdditionalColor.AllowDrop = true; + labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle; + labelAdditionalColor.Location = new Point(175, 8); + labelAdditionalColor.Name = "labelAdditionalColor"; + labelAdditionalColor.Size = new Size(147, 47); + labelAdditionalColor.TabIndex = 10; + labelAdditionalColor.Text = "Доп. цвет"; + labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter; + labelAdditionalColor.DragDrop += LabelAdditionalColor_DragDrop; + labelAdditionalColor.DragEnter += LabelAdditionalColor_DragEnter; + // + // labelBodyColor + // + labelBodyColor.AllowDrop = true; + labelBodyColor.BorderStyle = BorderStyle.FixedSingle; + labelBodyColor.Location = new Point(3, 8); + labelBodyColor.Name = "labelBodyColor"; + labelBodyColor.Size = new Size(147, 47); + labelBodyColor.TabIndex = 9; + labelBodyColor.Text = "Цвет"; + labelBodyColor.TextAlign = ContentAlignment.MiddleCenter; + labelBodyColor.DragDrop += LabelBodyColor_DragDrop; + labelBodyColor.DragEnter += LabelBodyColor_DragEnter; + // + // FormTankConfig + // + AutoScaleDimensions = new SizeF(13F, 32F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1234, 432); + Controls.Add(panelObject); + Controls.Add(buttonCancel); + Controls.Add(buttonAdd); + Controls.Add(groupBoxConfig); + Name = "FormTankConfig"; + Text = "FormTankConfig"; + groupBoxConfig.ResumeLayout(false); + groupBoxConfig.PerformLayout(); + groupBoxColors.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)numericUpDownWeight).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).EndInit(); + ((System.ComponentModel.ISupportInitialize)pictureBoxObject).EndInit(); + panelObject.ResumeLayout(false); + ResumeLayout(false); + } + + #endregion + + private GroupBox groupBoxConfig; + private Label labelModifiedObject; + private Label labelSimpleObject; + private NumericUpDown numericUpDownWeight; + private Label labelWeight; + private NumericUpDown numericUpDownSpeed; + private Label labelSpeed; + private CheckBox checkBoxPushka; + private CheckBox checkBoxPulemet; + private GroupBox groupBoxColors; + private Panel panelRed; + private Panel panelPurple; + private Panel panelBlack; + private Panel panelGray; + private Panel panelWhite; + private Panel panelYellow; + private Panel panelBlue; + private Panel panelGreen; + private PictureBox pictureBoxObject; + private Button buttonAdd; + private Button buttonCancel; + private Panel panelObject; + private Label labelAdditionalColor; + private Label labelBodyColor; + } +} \ No newline at end of file diff --git a/Tank/Tank/FormTankConfig.cs b/Tank/Tank/FormTankConfig.cs new file mode 100644 index 0000000..02c5345 --- /dev/null +++ b/Tank/Tank/FormTankConfig.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Tank.Drowings; +using Tank.Entities; + +namespace Tank; + +public partial class FormTankConfig : Form +{ + private DrawningMachine? _machine = null; + + /// + /// + /// + private event Action? _machineDelegate; + + public FormTankConfig() + { + InitializeComponent(); + + panelRed.MouseDown += Panel_MouseDown; + panelGreen.MouseDown += Panel_MouseDown; + panelBlue.MouseDown += Panel_MouseDown; + panelYellow.MouseDown += Panel_MouseDown; + panelWhite.MouseDown += Panel_MouseDown; + panelGray.MouseDown += Panel_MouseDown; + panelBlack.MouseDown += Panel_MouseDown; + panelPurple.MouseDown += Panel_MouseDown; + + buttonCancel.Click += (sender, e) => Close(); + } + + private void LabelBodyColor_DragDrop(object sender, DragEventArgs? e) + { + if (_machine == null) return; + _machine.EntityMachine?.SetBodyColor((Color)e.Data.GetData(typeof(Color))); + DrawObject(); + } + + private void DrawObject() + { + Bitmap bmp = new(pictureBoxObject.Width, pictureBoxObject.Height); + Graphics gr = Graphics.FromImage(bmp); + _machine?.SetPictureSize(pictureBoxObject.Width, + pictureBoxObject.Height); + _machine?.SetPosition(15, 15); + _machine?.DrawTransport(gr); + pictureBoxObject.Image = bmp; + } + + public void AddEvent(Action machineDelegate) + { + _machineDelegate += machineDelegate; + } + + private void ButtonAdd_Click(object sender, EventArgs e) + { + { + if (_machine != null) + { + _machineDelegate?.Invoke(_machine); + Close(); + } + } + } + + private void LabelObject_MouseDown(object sender, MouseEventArgs e) + { + (sender as Label)?.DoDragDrop((sender as Label)?.Name, DragDropEffects.Move | DragDropEffects.Copy); + } + + private void PanelObject_DragEnter(object sender, DragEventArgs e) + { + e.Effect = e.Data?.GetDataPresent(DataFormats.Text) ?? false ? e.Effect = DragDropEffects.Copy : e.Effect = DragDropEffects.None; + } + + private void PanelObject_DragDrop(object sender, DragEventArgs e) + { + { + switch (e.Data?.GetData(DataFormats.Text)?.ToString()) + { + case "labelSimpleObject": + _machine = new DrawningMachine((int)numericUpDownSpeed.Value, + (double)numericUpDownWeight.Value, Color.White); + break; + case "labelModifiedObject": + _machine = new + DrawningTank((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, + Color.White, + Color.Black, checkBoxPushka.Checked, + checkBoxPulemet.Checked); + break; + } + DrawObject(); + + } + } + + private void LabelBodyColor_DragEnter(object sender, DragEventArgs e) + { + if (e.Data.GetDataPresent(typeof(Color))) e.Effect = DragDropEffects.Copy; + else e.Effect = DragDropEffects.None; + } + + private void LabelAdditionalColor_DragEnter(object sender, DragEventArgs e) + { + if (_machine is DrawningTank) + { + if (e.Data.GetDataPresent(typeof(Color))) + { + e.Effect = DragDropEffects.Copy; + } + else + { + e.Effect = DragDropEffects.None; + } + } + } + private void LabelAdditionalColor_DragDrop(object sender, DragEventArgs e) + { + if (_machine?.EntityMachine is EntityTank _tank) + { + _tank.SetAdditional((Color)e.Data.GetData(typeof(Color))); + } + DrawObject(); + } + + private void Panel_MouseDown(object? sender, MouseEventArgs e) + { + (sender as Control)?.DoDragDrop((sender as Control)?.BackColor!, DragDropEffects.Move | DragDropEffects.Copy); + } +} diff --git a/Tank/Tank/FormTankConfig.resx b/Tank/Tank/FormTankConfig.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/Tank/Tank/FormTankConfig.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file -- 2.25.1