From d68201af1adbb9af5e012543326e1da324892c78 Mon Sep 17 00:00:00 2001 From: ILYAkuznetsov73 <148066069+ILYAkuznetsov73@users.noreply.github.com> Date: Tue, 21 May 2024 21:30:52 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=20=D0=BD=D0=B5=D0=BD=D1=83=D0=B6=D0=BD=D1=8B=D1=85?= =?UTF-8?q?=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lab1_OAP/Lab1_OAP.sln | 31 ----- Lab1_OAP/Lab1_OAP/Lab1_OAP.cpp | 1 - Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj | 135 ------------------ Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj.filters | 22 --- laboap1/laboap1.sln | 31 ----- laboap1/laboap1/laboap1.cpp | 151 --------------------- laboap1/laboap1/laboap1.vcxproj | 136 ------------------- laboap1/laboap1/laboap1.vcxproj.filters | 22 --- 8 files changed, 529 deletions(-) delete mode 100644 Lab1_OAP/Lab1_OAP.sln delete mode 100644 Lab1_OAP/Lab1_OAP/Lab1_OAP.cpp delete mode 100644 Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj delete mode 100644 Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj.filters delete mode 100644 laboap1/laboap1.sln delete mode 100644 laboap1/laboap1/laboap1.cpp delete mode 100644 laboap1/laboap1/laboap1.vcxproj delete mode 100644 laboap1/laboap1/laboap1.vcxproj.filters diff --git a/Lab1_OAP/Lab1_OAP.sln b/Lab1_OAP/Lab1_OAP.sln deleted file mode 100644 index 92627e6..0000000 --- a/Lab1_OAP/Lab1_OAP.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.8.34525.116 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lab1_OAP", "Lab1_OAP\Lab1_OAP.vcxproj", "{39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}" -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 - {39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}.Debug|x64.ActiveCfg = Debug|x64 - {39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}.Debug|x64.Build.0 = Debug|x64 - {39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}.Debug|x86.ActiveCfg = Debug|Win32 - {39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}.Debug|x86.Build.0 = Debug|Win32 - {39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}.Release|x64.ActiveCfg = Release|x64 - {39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}.Release|x64.Build.0 = Release|x64 - {39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}.Release|x86.ActiveCfg = Release|Win32 - {39E703FF-4168-4ACA-84CA-CDD94BFE3FD3}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {AD8890FA-E7D7-4EB8-996C-597872ABE83B} - EndGlobalSection -EndGlobal diff --git a/Lab1_OAP/Lab1_OAP/Lab1_OAP.cpp b/Lab1_OAP/Lab1_OAP/Lab1_OAP.cpp deleted file mode 100644 index 5f28270..0000000 --- a/Lab1_OAP/Lab1_OAP/Lab1_OAP.cpp +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj b/Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj deleted file mode 100644 index 7b4bd6f..0000000 --- a/Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {39e703ff-4168-4aca-84ca-cdd94bfe3fd3} - Lab1OAP - 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/Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj.filters b/Lab1_OAP/Lab1_OAP/Lab1_OAP.vcxproj.filters deleted file mode 100644 index 0805cb7..0000000 --- a/Lab1_OAP/Lab1_OAP/Lab1_OAP.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/laboap1/laboap1.sln b/laboap1/laboap1.sln deleted file mode 100644 index 9f5ffa8..0000000 --- a/laboap1/laboap1.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.8.34525.116 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "laboap1", "laboap1\laboap1.vcxproj", "{1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}" -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 - {1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}.Debug|x64.ActiveCfg = Debug|x64 - {1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}.Debug|x64.Build.0 = Debug|x64 - {1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}.Debug|x86.ActiveCfg = Debug|Win32 - {1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}.Debug|x86.Build.0 = Debug|Win32 - {1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}.Release|x64.ActiveCfg = Release|x64 - {1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}.Release|x64.Build.0 = Release|x64 - {1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}.Release|x86.ActiveCfg = Release|Win32 - {1F4724C2-6BC1-42C2-ACC1-93AAA85BA624}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {898933DD-7FA8-4FA7-872F-63991ACB024A} - EndGlobalSection -EndGlobal diff --git a/laboap1/laboap1/laboap1.cpp b/laboap1/laboap1/laboap1.cpp deleted file mode 100644 index 0329b66..0000000 --- a/laboap1/laboap1/laboap1.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include -#include - -void printArray(int arr[], int size) { - for (int i = 0; i < size; i++) { - printf("%d ", arr[i]); - } - printf("\n"); -} - -void insertionSort(int arr[], int size) { - int i, key, j; - for (i = 1; i < size; i++) { - key = arr[i]; - j = i - 1; - - while (j >= 0 && arr[j] > key) { - arr[j + 1] = arr[j]; - j = j - 1; - } - arr[j + 1] = key; - } -} - -void merge(int arr[], int left, int mid, int right) { - int i, j, k; - int n1 = mid - left + 1; - int n2 = right - mid; - - int L[n1], R[n2]; - - for (i = 0; i < n1; i++) - L[i] = arr[left + i]; - for (j = 0; j < n2; j++) - R[j] = arr[mid + 1 + j]; - - i = 0; - j = 0; - k = left; - while (i < n1 && j < n2) { - if (L[i] <= R[j]) { - arr[k] = L[i]; - i++; - } - else { - arr[k] = R[j]; - j++; - } - k++; - } - - while (i < n1) { - arr[k] = L[i]; - i++; - k++; - } - - while (j < n2) { - arr[k] = R[j]; - j++; - k++; - } -} - -void mergeSort(int arr[], int left, int right) { - if (left < right) { - int mid = left + (right - left) / 2; - - mergeSort(arr, left, mid); - mergeSort(arr, mid + 1, right); - - merge(arr, left, mid, right); - } -} - -int main() { - srand(time(0)); - - int size; - printf("Enter the size of the array: "); - scanf("%d", &size); - - int arr[size]; - for (int i = 0; i < size; i++) { - arr[i] = rand() % 100; - } - - printf("Randomly generated array: "); - printArray(arr, size); - - int choice; - printf("Enter 1 to delete an element, 2 to insert a new element: "); - scanf("%d", &choice); - - if (choice == 1) { - int index; - printf("Enter the index of the element you want to delete: "); - scanf("%d", &index); - - for (int i = index; i < size - 1; i++) { - arr[i] = arr[i + 1]; - } - size--; - } - else if (choice == 2) { - int index, element; - printf("Enter the index at which you want to insert the new element: "); - scanf("%d", &index); - printf("Enter the new element: "); - scanf("%d", &element); - - for (int i = size; i > index; i--) { - arr[i] = arr[i - 1]; - } - arr[index] = element; - size++; - } - else { - printf("Invalid choice"); - return 0; - } - - printf("Modified array: "); - printArray(arr, size); - - int arr_copy[size]; - for (int i = 0; i < size; i++) { - arr_copy[i] = arr[i]; - } - - clock_t start_time = clock(); - insertionSort(arr, size); - clock_t end_time = clock(); - double insertion_time = ((double)(end_time - start_time)) / CLOCKS_PER_SEC; - - printf("Array sorted using Insertion Sort: "); - printArray(arr, size); - printf("Time taken by Insertion Sort: %f seconds\n", insertion_time); - - start_time = clock(); - mergeSort(arr_copy, 0, size - 1); - end_time = clock(); - double merge_time = ((double)(end_time - start_time)) / CLOCKS_PER_SEC; - - printf("Array sorted using Merge Sort: "); - printArray(arr_copy, size); - printf("Time taken by Merge Sort: %f seconds\n", merge_time); - - return 0; -} \ No newline at end of file diff --git a/laboap1/laboap1/laboap1.vcxproj b/laboap1/laboap1/laboap1.vcxproj deleted file mode 100644 index 085cb5f..0000000 --- a/laboap1/laboap1/laboap1.vcxproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {1f4724c2-6bc1-42c2-acc1-93aaa85ba624} - laboap1 - 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 - Default - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/laboap1/laboap1/laboap1.vcxproj.filters b/laboap1/laboap1/laboap1.vcxproj.filters deleted file mode 100644 index 2bff827..0000000 --- a/laboap1/laboap1/laboap1.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