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