diff --git a/KaganovDA/lab1/build/lab1_postfix/lab1_postfix.sln b/KaganovDA/lab1/build/lab1_postfix/lab1_postfix.sln
new file mode 100644
index 000000000..54752393f
--- /dev/null
+++ b/KaganovDA/lab1/build/lab1_postfix/lab1_postfix.sln
@@ -0,0 +1,44 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27428.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab1_postfix", "lab1_postfix\lab1_postfix.vcxproj", "{95F7E418-95C2-4635-BC46-D40F28AD12E9}"
+ ProjectSection(ProjectDependencies) = postProject
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27} = {B5706D27-C05E-4ACB-97DD-E035B8100D27}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "postfix_lib", "postfix_lib\postfix_lib.vcxproj", "{B5706D27-C05E-4ACB-97DD-E035B8100D27}"
+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
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}.Debug|x64.ActiveCfg = Debug|x64
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}.Debug|x64.Build.0 = Debug|x64
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}.Debug|x86.ActiveCfg = Debug|Win32
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}.Debug|x86.Build.0 = Debug|Win32
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}.Release|x64.ActiveCfg = Release|x64
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}.Release|x64.Build.0 = Release|x64
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}.Release|x86.ActiveCfg = Release|Win32
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}.Release|x86.Build.0 = Release|Win32
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}.Debug|x64.ActiveCfg = Debug|x64
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}.Debug|x64.Build.0 = Debug|x64
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}.Debug|x86.ActiveCfg = Debug|Win32
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}.Debug|x86.Build.0 = Debug|Win32
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}.Release|x64.ActiveCfg = Release|x64
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}.Release|x64.Build.0 = Release|x64
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}.Release|x86.ActiveCfg = Release|Win32
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {F7CEAC78-A731-4BDD-9E9D-DAAB4F19BE3D}
+ EndGlobalSection
+EndGlobal
diff --git a/KaganovDA/lab1/build/lab1_postfix/lab1_postfix/lab1_postfix.vcxproj b/KaganovDA/lab1/build/lab1_postfix/lab1_postfix/lab1_postfix.vcxproj
new file mode 100644
index 000000000..b7d277aa4
--- /dev/null
+++ b/KaganovDA/lab1/build/lab1_postfix/lab1_postfix/lab1_postfix.vcxproj
@@ -0,0 +1,161 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+
+
+
+ 15.0
+ {95F7E418-95C2-4635-BC46-D40F28AD12E9}
+ Win32Proj
+ lab1postfix
+ 10.0.16299.0
+
+
+
+ Application
+ true
+ v141
+ Unicode
+
+
+ Application
+ false
+ v141
+ true
+ Unicode
+
+
+ Application
+ true
+ v141
+ Unicode
+
+
+ Application
+ false
+ v141
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ ..\..\..\include
+
+
+ Console
+ true
+ postfix_lib.lib;%(AdditionalDependencies)
+ ..\Debug
+
+
+
+
+ Use
+ Level3
+ Disabled
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ NotUsing
+ Level3
+ MaxSpeed
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ ..\..\..\include
+
+
+ Console
+ true
+ true
+ true
+ postfix_lib.lib;%(AdditionalDependencies)
+ ..\Release
+
+
+
+
+ Use
+ Level3
+ MaxSpeed
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+
+
\ No newline at end of file
diff --git a/KaganovDA/lab1/build/lab1_postfix/lab1_postfix/lab1_postfix.vcxproj.filters b/KaganovDA/lab1/build/lab1_postfix/lab1_postfix/lab1_postfix.vcxproj.filters
new file mode 100644
index 000000000..e85f300f4
--- /dev/null
+++ b/KaganovDA/lab1/build/lab1_postfix/lab1_postfix/lab1_postfix.vcxproj.filters
@@ -0,0 +1,14 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+
+
+ Исходные файлы
+
+
+
\ No newline at end of file
diff --git a/KaganovDA/lab1/build/lab1_postfix/postfix_lib/postfix_lib.vcxproj b/KaganovDA/lab1/build/lab1_postfix/postfix_lib/postfix_lib.vcxproj
new file mode 100644
index 000000000..82515f860
--- /dev/null
+++ b/KaganovDA/lab1/build/lab1_postfix/postfix_lib/postfix_lib.vcxproj
@@ -0,0 +1,168 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 15.0
+ {B5706D27-C05E-4ACB-97DD-E035B8100D27}
+ Win32Proj
+ postfixlib
+ 10.0.16299.0
+
+
+
+ StaticLibrary
+ true
+ v141
+ Unicode
+
+
+ StaticLibrary
+ false
+ v141
+ true
+ Unicode
+
+
+ StaticLibrary
+ true
+ v141
+ Unicode
+
+
+ StaticLibrary
+ false
+ v141
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ true
+ WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ ..\..\..\include
+
+
+
+ Windows
+ true
+
+
+
+
+ Use
+ Level3
+ Disabled
+ true
+ _DEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+
+
+
+
+ NotUsing
+ Level3
+ MaxSpeed
+ true
+ true
+ true
+ WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ ..\..\..\include
+
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+ Use
+ Level3
+ MaxSpeed
+ true
+ true
+ true
+ NDEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+
+
\ No newline at end of file
diff --git a/KaganovDA/lab1/build/lab1_postfix/postfix_lib/postfix_lib.vcxproj.filters b/KaganovDA/lab1/build/lab1_postfix/postfix_lib/postfix_lib.vcxproj.filters
new file mode 100644
index 000000000..30a2eb777
--- /dev/null
+++ b/KaganovDA/lab1/build/lab1_postfix/postfix_lib/postfix_lib.vcxproj.filters
@@ -0,0 +1,41 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
+
+
+
+
+ Исходные файлы
+
+
+ Исходные файлы
+
+
+ Исходные файлы
+
+
+ Исходные файлы
+
+
+
+
+ Файлы заголовков
+
+
+ Файлы заголовков
+
+
+ Файлы заголовков
+
+
+ Файлы заголовков
+
+
+
\ No newline at end of file
diff --git a/KaganovDA/lab1/doc/Postfix_one.pdf b/KaganovDA/lab1/doc/Postfix_one.pdf
new file mode 100644
index 000000000..a2b4efc95
Binary files /dev/null and b/KaganovDA/lab1/doc/Postfix_one.pdf differ
diff --git a/KaganovDA/lab1/include/List.h b/KaganovDA/lab1/include/List.h
new file mode 100644
index 000000000..1730435ea
--- /dev/null
+++ b/KaganovDA/lab1/include/List.h
@@ -0,0 +1,154 @@
+#ifndef POLISH_LIST_H
+#define POLISH_LIST_H
+
+#include "Node.h"
+
+template
+
+class List {
+private:
+ Node* root;
+public:
+ List();
+ List(const List&);
+ ~List();
+ void Add(TKey); //
+ void Remove(TKey); //
+ void InsertBefore(TKey, TKey); //
+ void InsertAfter(TKey, TKey); //
+ void InsertEnd(TKey); //
+ void Print()const; //
+ int Size()const; //
+ TKey GetRoot()const;
+ Node* Search(TKey); //
+};
+
+template
+List::List() {
+ root = 0;
+};
+
+template
+List::List(const List& L) {
+ L->pNext = this->root;
+ this->root = L;
+};
+
+template
+List::~List() {
+ while (root != 0) {
+ Node* tmp = root;
+ root = root->pNext;
+ delete tmp;
+ }
+ delete root;
+};
+
+template
+void List::Add(TKey key) {
+ Node* a = new Node;
+ a->key = key;
+ a->pNext = root;
+ root = a;
+};
+
+template
+void List::Remove(TKey key) {
+ if (root == 0)
+ throw "List Is Empty";
+ if (this->root->key == key) {
+ Node* a = root;
+ root = root->pNext;
+ delete a;
+ return;
+ }
+ Node* tmp = root;
+ while (tmp->pNext != 0 && tmp->pNext->key != key)
+ tmp = tmp->pNext;
+ if (tmp->pNext == 0)
+ throw "Key Not Found";
+ Node* a = tmp->pNext;
+ tmp->pNext = a->pNext;
+};
+
+template
+void List::InsertBefore(TKey key, TKey KeyNext) {
+ if (root == 0)
+ throw "List Is Empty";
+ if (root->key == key) {
+ root = new Node;
+ root->key = key;
+ }
+};
+
+template
+void List::InsertAfter(TKey key, TKey KeyPrev) {
+ if (root == 0)
+ throw "List Is Empty";
+ while (root->pNext != 0 && root->key != KeyPrev)
+ root = root->pNext;
+ if (root->pNext == 0 && root->key != KeyPrev)
+ throw "Key Not Found";
+ Node* a = new Node;
+ a->key = key;
+ a->pNext = root->pNext;
+ root->pNext = a;
+};
+
+template
+void List::InsertEnd(TKey key) {
+ if (root == 0) {
+ root = new Node;
+ root->key = key;
+ root->pNext = 0;
+ return;
+ }
+ while (root->pNext != 0)
+ root = root->pNext;
+ root->pNext = new Node;
+ root->pNext->key = key;
+ root->pNext->pNext = 0;
+};
+
+template
+void List::Print()const {
+ if (root == 0)
+ throw "Stack Is Empty";
+ Node* a = root;
+ while (a != 0) {
+ cout << a->key << " ";
+ a = a->pNext;
+ }
+ cout << endl;
+};
+
+template
+int List::Size()const {
+ Node* a = root;
+ int i = 0;
+ while (a != 0) {
+ i++;
+ a = a->pNext;
+ }
+ return i;
+};
+
+template
+TKey List::GetRoot()const {
+ if (root != 0)
+ return root->key;
+ else
+ return 1;
+}
+
+template
+Node* List::Search(TKey key) {
+ Node* a = root;
+ while (a != 0 && a->key != key)
+ a = a->pNext;
+ if (a == 0)
+ throw "Key Not Found";
+ return a;
+};
+
+#endif
\ No newline at end of file
diff --git a/KaganovDA/lab1/include/Node.h b/KaganovDA/lab1/include/Node.h
new file mode 100644
index 000000000..08262851a
--- /dev/null
+++ b/KaganovDA/lab1/include/Node.h
@@ -0,0 +1,11 @@
+#ifndef POLISH_NODE_H
+#define POLISH_NODE_H
+
+template
+
+struct Node {
+ TKey key;
+ Node* pNext;
+};
+
+#endif
\ No newline at end of file
diff --git a/KaganovDA/lab1/include/Stack.h b/KaganovDA/lab1/include/Stack.h
new file mode 100644
index 000000000..c07c2f6f7
--- /dev/null
+++ b/KaganovDA/lab1/include/Stack.h
@@ -0,0 +1,85 @@
+#ifndef POLISH_STACK_H
+#define POLISH_STACK_H
+
+#include "List.h"
+#include
+using namespace std;
+
+template
+
+class Stack {
+private:
+ List* list;
+public:
+ Stack();
+ Stack(const Stack&);
+ ~Stack();
+ void Push(TKey); //
+ TKey Pop(); //
+ TKey Take()const; //
+ bool IsEmpty()const; //
+ bool IsFull()const; //
+};
+
+template
+Stack::Stack() {
+ list = new List;
+};
+
+template
+Stack::~Stack() {
+ delete list;
+};
+
+template
+Stack::Stack(const Stack& S) {
+ list = new List(S.list);
+};
+
+template
+void Stack::Push(TKey key) {
+ if (IsFull())
+ throw "Stack Is Full";
+ list->Add(key);
+};
+
+template
+TKey Stack::Pop() {
+ if (IsEmpty())
+ throw "Stack Is Empty";
+ TKey key = list->GetRoot();
+ try {
+ list->Remove(key);
+ }
+ catch (const char* error) {
+ cout << error << endl;
+ }
+ return key;
+};
+
+template
+TKey Stack::Take()const {
+ if (IsEmpty())
+ throw "Stack Is Empty";
+ return List.GetRoot();
+};
+
+template
+bool Stack::IsEmpty()const {
+ return(list->Size() == 0);
+};
+
+template
+bool Stack::IsFull()const {
+ TKey key = -1;
+ try {
+ list->Add(key);
+ list->Remove(key);
+ }
+ catch (...) {
+ return true;
+ }
+ return false;
+};
+
+#endif
\ No newline at end of file
diff --git a/KaganovDA/lab1/include/postfix.h b/KaganovDA/lab1/include/postfix.h
new file mode 100644
index 000000000..57777adfb
--- /dev/null
+++ b/KaganovDA/lab1/include/postfix.h
@@ -0,0 +1,25 @@
+#ifndef POLISH_POSTFIX_H
+#define POLISH_POSTFIX_H
+
+#include
+#include
+#include