├── .gitattributes
├── .gitignore
├── AlgorithmTest
├── AlgorithmTest.vcxproj
├── AlgorithmTest.vcxproj.filters
├── DataStructuresTest.cpp
├── FamousProblemsTest.cpp
├── GraphTest.cpp
├── MathTest.cpp
├── SortingTest.cpp
├── StringTest.cpp
├── packages.config
├── pch.cpp
├── pch.h
└── test.cpp
├── Algorithms.sln
├── Algorithms
├── Algorithms.vcxproj
├── Algorithms.vcxproj.filters
├── Source_processed.cpp
├── include
│ ├── DataStructures
│ │ ├── FenwickTree.h
│ │ ├── LazySegmentTree.h
│ │ ├── RedBlackTree.h
│ │ ├── SegmentTree.h
│ │ ├── SkipList.h
│ │ ├── SparseTable.h
│ │ └── Trie.h
│ ├── Defines.h
│ ├── FamousProblems
│ │ ├── AllProblems.h
│ │ └── Sudoku.h
│ ├── Geometry
│ │ └── Geometry.h
│ ├── Graph
│ │ ├── Bipartite.h
│ │ ├── Bridges.h
│ │ ├── ChromaticNumber.h
│ │ ├── Components.h
│ │ ├── CutPoints.h
│ │ ├── CycleChecker.h
│ │ ├── DSU.h
│ │ ├── Dijkstra.h
│ │ ├── Euler.h
│ │ ├── FloydWarshall.h
│ │ ├── FordBellman.h
│ │ ├── Graph.h
│ │ ├── Khun.h
│ │ ├── Kruskal.h
│ │ ├── LCA.h
│ │ ├── PruferCode.h
│ │ ├── StrongComponents.h
│ │ └── Toposort.h
│ ├── Math
│ │ └── Math.h
│ ├── Sortings
│ │ └── Sorting.h
│ ├── Strings
│ │ ├── KnuthMorrisPratt.h
│ │ ├── PrefixFunction.h
│ │ ├── StringHashing.h
│ │ └── ZFunction.h
│ ├── Utils.h
│ └── Utils.hpp
└── src
│ ├── DataStructures
│ └── Trie.cpp
│ ├── Geometry
│ └── Geometry.cpp
│ ├── Graph
│ ├── Bipartite.cpp
│ ├── Bridges.cpp
│ ├── ChromaticNumber.cpp
│ ├── Components.cpp
│ ├── CutPoints.cpp
│ ├── CycleChecker.cpp
│ ├── DSU.cpp
│ ├── Dijkstra.cpp
│ ├── Euler.cpp
│ ├── FloydWarshall.cpp
│ ├── FordBellman.cpp
│ ├── Graph.cpp
│ ├── Khun.cpp
│ ├── Kruskal.cpp
│ ├── LCA.cpp
│ ├── PruferCode.cpp
│ ├── StrongComponents.cpp
│ └── Toposort.cpp
│ ├── Math
│ └── Math.cpp
│ └── Strings
│ ├── KnuthMorrisPratt.cpp
│ ├── PrefixFunction.cpp
│ ├── StringHashing.cpp
│ └── ZFunction.cpp
├── CodePreprocessor
├── CodePreprocessor.vcxproj
├── CodePreprocessor.vcxproj.filters
├── FileProcessor.cpp
├── FileProcessor.h
├── FileSearcher.cpp
├── FileSearcher.h
├── Source.cpp
└── Source_processed.cpp
├── Coding
├── Coding.vcxproj
├── Coding.vcxproj.filters
├── Source.cpp
├── Source_processed.cpp
├── input.txt
└── package-lock.json
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/AlgorithmTest/AlgorithmTest.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | {bbffcc52-30d0-4e22-8e51-41245d12e1f1}
23 | Win32Proj
24 | 10.0
25 | Application
26 | v142
27 | Unicode
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | $(SolutionDir)$(Configuration)\;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64
37 | $(SolutionDir)packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.0\build\native\include;$(SolutionDir)Algorithms\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)
38 |
39 |
40 | $(SolutionDir)$(Configuration)\;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86
41 | $(SolutionDir)\Algorithms\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.0\build\native\include;$(SolutionDir)\Algorithms\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)
42 |
43 |
44 | $(SolutionDir)$(Configuration)\;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86
45 | $(SolutionDir)\Algorithms\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.0\build\native\include;$(SolutionDir)\Algorithms\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)
46 |
47 |
48 | $(SolutionDir)\Algorithms\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.0\build\native\include;$(SolutionDir)\Algorithms\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)
49 | $(SolutionDir)$(Configuration)\;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | Create
64 | Create
65 | Create
66 | Create
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 | Use
80 | pch.h
81 | Disabled
82 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
83 | true
84 | EnableFastChecks
85 | MultiThreadedDebugDLL
86 | Level3
87 |
88 |
89 | true
90 | Console
91 | Algorithms.lib;$(MSBuildThisFileDirectory)..\packages\.*\lib\native\v140\windesktop\msvcstl\static\rt-dyn\x86\Debug\gtest_main.lib;%(AdditionalDependencies)
92 | $(ProjectDir)../x64/Debug
93 |
94 |
95 | echo $(ExecutableDir)..\Algorithms\include
96 |
97 |
98 |
99 |
100 | Use
101 | pch.h
102 | Disabled
103 | X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
104 | true
105 | EnableFastChecks
106 | MultiThreadedDebugDLL
107 | Level3
108 | false
109 | 16Bytes
110 |
111 |
112 | true
113 | Console
114 | Algorithms.lib;gtest_main.lib;gtest.lib;%(AdditionalDependencies)
115 | $(ProjectDir)../x64/Debug;$(SolutionDir)packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.0\lib\native\v140\windesktop\msvcstl\static\rt-dyn\x64\Debug
116 |
117 |
118 |
119 |
120 | Use
121 | pch.h
122 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
123 | MultiThreadedDLL
124 | Level3
125 | ProgramDatabase
126 |
127 |
128 | true
129 | Console
130 | true
131 | true
132 | Algorithms.lib;$(MSBuildThisFileDirectory)..\packages\.*\lib\native\v140\windesktop\msvcstl\static\rt-dyn\x86\Release\gtest_main.lib;%(AdditionalDependencies)
133 | $(ProjectDir)../x64/Debug
134 |
135 |
136 | echo $(ExecutableDir)..\Algorithms\include
137 |
138 |
139 |
140 |
141 | Use
142 | pch.h
143 | X64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
144 | MultiThreadedDLL
145 | Level3
146 | ProgramDatabase
147 |
148 |
149 | true
150 | Console
151 | true
152 | true
153 | Algorithms.lib;$(MSBuildThisFileDirectory)..\..\lib\native\v140\windesktop\msvcstl\static\rt-dyn\x64\Release\gtest_main.lib;%(AdditionalDependencies)
154 | $(ProjectDir)../x64/Debug
155 |
156 |
157 |
158 |
159 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
160 |
161 |
162 |
163 |
--------------------------------------------------------------------------------
/AlgorithmTest/AlgorithmTest.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Tests
7 |
8 |
9 | Tests
10 |
11 |
12 | Tests
13 |
14 |
15 | Tests
16 |
17 |
18 | Tests
19 |
20 |
21 | Tests
22 |
23 |
24 | Tests
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | {d98e02ef-27de-4326-98c0-e1b8a977eb72}
36 |
37 |
38 |
--------------------------------------------------------------------------------
/AlgorithmTest/DataStructuresTest.cpp:
--------------------------------------------------------------------------------
1 | #include"pch.h"
2 |
3 | #include"DataStructures/SegmentTree.h"
4 | #include"DataStructures/Trie.h"
5 | #include"DataStructures/SparseTable.h"
6 | #include"DataStructures/FenwickTree.h"
7 | #include
8 | #include
9 |
10 | int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
11 | int sum_on_vector(const std::vector& vec, int i, int j)
12 | {
13 | int sum = 0;
14 | while (i <= j)
15 | {
16 | sum += vec[i++];
17 | }
18 | return sum;
19 | }
20 | int mul_on_vector(const std::vector& vec, int i, int j)
21 | {
22 | int mul = 1;
23 | while (i <= j)
24 | {
25 | mul *= vec[i++];
26 | }
27 | return mul;
28 | }
29 | int min_on_vector(const std::vector& vec, int i, int j)
30 | {
31 | int g = vec[i++];
32 | while (i <= j)
33 | {
34 | g = std::min(g, vec[i++]);
35 | }
36 | return g;
37 | }
38 | int max_on_vector(const std::vector& vec, int i, int j)
39 | {
40 | int g = vec[i++];
41 | while (i <= j)
42 | {
43 | g = std::max(g, vec[i++]);
44 | }
45 | return g;
46 | }
47 | int gcd_on_vector(const std::vector& vec, int i, int j)
48 | {
49 | int g = vec[i++];
50 | while (i <= j)
51 | {
52 | g = gcd(g, vec[i++]);
53 | }
54 | return g;
55 | }
56 |
57 |
58 |
59 | TEST(SegmentTreeTest, DataStructures)
60 | {
61 | std::mt19937 rand_function(time(0));
62 | // sum
63 | for (int i = 0; i < 10; ++i)
64 | {
65 | std::vector vec = getRandomVector(1000, 1, 100);
66 | algo::SegmentTree tree(vec, std::plus(), 0);
67 | tree.build_tree();
68 | std::uniform_int_distribution uid(0, vec.size() - 1);
69 | int a = uid(rand_function);
70 | int b = uid(rand_function);
71 | if (a > b)
72 | std::swap(a, b);
73 | EXPECT_EQ(tree.query(a, b), sum_on_vector(vec, a, b));
74 | tree.update(a, vec[a] + 1);
75 | }
76 | // product
77 | for (int i = 0; i < 10; ++i)
78 | {
79 | std::vector vec = getRandomVector(1000, -1, 1);
80 | algo::SegmentTree tree(vec, std::multiplies(), 1);
81 | tree.build_tree();
82 | std::uniform_int_distribution uid(0, vec.size() - 1);
83 | int a = uid(rand_function);
84 | int b = uid(rand_function);
85 | if (a > b)
86 | std::swap(a, b);
87 | EXPECT_EQ(tree.query(a, b), mul_on_vector(vec, a, b));
88 | tree.update(a, vec[a] + 1);
89 | }
90 | // min
91 | for (int i = 0; i < 10; ++i)
92 | {
93 | std::vector vec = getRandomVector(1000, -1111, 1111);
94 | const int& (*operation)(const int&, const int&) = std::min;
95 | algo::SegmentTree tree(vec, operation, 1111);
96 | tree.build_tree();
97 | std::uniform_int_distribution uid(0, vec.size() - 1);
98 | int a = uid(rand_function);
99 | int b = uid(rand_function);
100 | if (a > b)
101 | std::swap(a, b);
102 | EXPECT_EQ(tree.query(a, b), min_on_vector(vec, a, b));
103 | tree.update(a, vec[a] + 1);
104 | }
105 | // max
106 | for (int i = 0; i < 10; ++i)
107 | {
108 | std::vector vec = getRandomVector(1000, -1111, 1111);
109 | const int& (*operation)(const int&, const int&) = std::max;
110 | algo::SegmentTree tree(vec, operation, -1111, algo::SegmentTree::UpdateType::Sum);
111 | tree.build_tree();
112 | std::uniform_int_distribution uid(0, vec.size() - 1);
113 | int a = uid(rand_function);
114 | int b = uid(rand_function);
115 | if (a > b)
116 | std::swap(a, b);
117 | EXPECT_EQ(tree.query(a, b), max_on_vector(vec, a, b));
118 | tree.update(a, vec[a] + 1);
119 | }
120 | // gcd
121 | for (int i = 0; i < 10; ++i)
122 | {
123 | std::vector vec = getRandomVector(1000, 1, 100);
124 | algo::SegmentTree tree(vec, [](int a, int b) { return gcd(a, b); }, 0);
125 | tree.build_tree();
126 | std::uniform_int_distribution uid(0, vec.size() - 1);
127 | int a = uid(rand_function);
128 | int b = uid(rand_function);
129 | if (a > b)
130 | std::swap(a, b);
131 | EXPECT_EQ(tree.query(a, b), gcd_on_vector(vec, a, b));
132 | tree.update(a, vec[a] + 1);
133 | }
134 | }
135 |
136 |
137 | TEST(LazySegmentTreeTest, DataStructures)
138 | {
139 | std::mt19937 rand_function(time(0));
140 | // sum
141 | for (int i = 0; i < 10; ++i)
142 | {
143 | std::vector vec = getRandomVector(1000, 1, 100);
144 | algo::SegmentTree tree(vec, std::plus(), 0, algo::SegmentTree::UpdateType::Sum);
145 | std::uniform_int_distribution uid(0, vec.size() - 1);
146 | int a = uid(rand_function);
147 | int b = uid(rand_function);
148 | if (a > b)
149 | std::swap(a, b);
150 | int value = uid(rand_function);
151 | tree.update(a, b, value);
152 | for (int i = a; i <= b; ++i)
153 | {
154 | vec[i] += value;
155 | }
156 | EXPECT_EQ(tree.query(a, b), sum_on_vector(vec, a, b));
157 | }
158 | }
159 |
160 | TEST(FenwickTreeTest, DataStructures)
161 | {
162 | std::mt19937 rand_function(time(0));
163 | // sum
164 | for (int i = 0; i < 10; ++i)
165 | {
166 | std::vector vec = getRandomVector(1000, 1, 100);
167 | algo::FenwickTree tree(vec);
168 | tree.build_tree();
169 | std::uniform_int_distribution uid(0, vec.size() - 1);
170 | int a = uid(rand_function);
171 | int b = uid(rand_function);
172 | if (a > b)
173 | std::swap(a, b);
174 | EXPECT_EQ(tree.query(a, b), sum_on_vector(vec, a, b));
175 | tree.update(a, vec[a] + 1);
176 | }
177 | }
178 |
179 |
180 | TEST(TrieTest, DataStructures)
181 | {
182 | algo::Trie trie;
183 | std::vector words =
184 | {
185 | "hello",
186 | "abba",
187 | "abacaba"
188 | };
189 | for (int i = 0; i < words.size(); ++i)
190 | {
191 | for (int j = 0; j < words[i].size(); ++j)
192 | {
193 | trie.add_word(words[i].substr(j));
194 | }
195 | }
196 | EXPECT_TRUE(trie.find_word("a"));
197 | EXPECT_FALSE(trie.find_word("b"));
198 | EXPECT_FALSE(trie.find_word("ell"));
199 | EXPECT_FALSE(trie.find_word("aca"));
200 | EXPECT_FALSE(trie.find_word("abaca"));
201 | EXPECT_TRUE(trie.find_word("acaba"));
202 | EXPECT_TRUE(trie.find_word("hello"));
203 | EXPECT_TRUE(trie.find_word("ello"));
204 | EXPECT_TRUE(trie.find_word("llo"));
205 | EXPECT_TRUE(trie.find_word("lo"));
206 | EXPECT_TRUE(trie.find_word("o"));
207 |
208 | }
209 |
210 |
211 | TEST(SparseTableTest, DataStructures)
212 | {
213 | std::mt19937 rand_function(time(0));
214 | for (int i = 0; i < 10; ++i)
215 | {
216 | std::vector vec = getRandomVector(1000, 10, 100);
217 | algo::SparseTable table(vec);
218 | std::uniform_int_distribution uid(0, vec.size() - 1);
219 | int a = uid(rand_function);
220 | int b = uid(rand_function);
221 | if (a > b)
222 | std::swap(a, b);
223 |
224 | EXPECT_EQ(table.query(a, b), min_on_vector(vec, a, b));
225 | }
226 |
227 | }
--------------------------------------------------------------------------------
/AlgorithmTest/FamousProblemsTest.cpp:
--------------------------------------------------------------------------------
1 | #include"pch.h"
2 |
3 | #include"FamousProblems\AllProblems.h"
4 |
5 | #include
6 | #include
7 |
8 |
9 | TEST(MatrixMultiplicationTest, FamousProblemsTest)
10 | {
11 | EXPECT_EQ(
12 | algo::MatrixMultProblem({ {10, 20}, {20, 30}, {30, 40}, {40, 30} }),
13 | 30000
14 | );
15 | EXPECT_EQ(
16 | algo::MatrixMultProblem({ {40, 20}, {20, 30}, {30, 10}, {10, 30} }),
17 | 26000
18 | );
19 | EXPECT_EQ(
20 | algo::MatrixMultProblem({ {10, 20}, {20, 30} }),
21 | 6000
22 | );
23 | }
24 |
25 | TEST(LivenshteinTest, FamousProblemsTest)
26 | {
27 | {
28 | std::string str1 = "dye";
29 | std::string str2 = "day";
30 | EXPECT_EQ(
31 | algo::Livenshtein(str1, str2),
32 | 2
33 | );
34 | }
35 | {
36 | std::string str1 = "exponential";
37 | std::string str2 = "polynomial";
38 | EXPECT_EQ(
39 | algo::Livenshtein(str1, str2),
40 | 6
41 | );
42 | }
43 | {
44 | std::string str1 = "kitten";
45 | std::string str2 = "sitting";
46 | EXPECT_EQ(
47 | algo::Livenshtein(str1, str2),
48 | 3
49 | );
50 | }
51 | {
52 | std::string str1 = "saturday";
53 | std::string str2 = "sunday";
54 | EXPECT_EQ(
55 | algo::Livenshtein(str1, str2),
56 | 3
57 | );
58 | }
59 | }
60 | TEST(LISTest, FamousProblemsTest)
61 | {
62 | {
63 | std::vector arr{ 0, 8, 4, 12, 2, 10, 6,
64 | 14, 1, 9, 5, 13, 3, 11, 7, 15 };
65 | EXPECT_EQ(algo::LIS(arr), 6);
66 | }
67 | {
68 | std::vector arr{ 1,2,3,4,5,6,7 };
69 | EXPECT_EQ(algo::LIS(arr), 7);
70 | }
71 | {
72 | std::vector arr{ 9, 7, 5, 3, 2, 1 };
73 | EXPECT_EQ(algo::LIS(arr), 1);
74 | }
75 | {
76 | std::vector arr{ 1, 2, 1, 6, 1, 8, 1, 9,
77 | 3, 10, 4, 5, 6, 7 };
78 | EXPECT_EQ(algo::LIS(arr), 7);
79 | }
80 | }
81 |
82 | TEST(LCSTest, FamousProblemsTest)
83 | {
84 | {
85 | std::string str1 = "agcat";
86 | std::string str2 = "gac";
87 | EXPECT_EQ(
88 | algo::LCS(str1, str2),
89 | 2
90 | );
91 | }
92 | {
93 | std::string str1 = "XMJYAUZ";
94 | std::string str2 = "MZJAWXU";
95 | EXPECT_EQ(
96 | algo::LCS(str1, str2),
97 | 4
98 | );
99 | }
100 | {
101 | std::string str1 = "aaaa";
102 | std::string str2 = "aaaa";
103 | EXPECT_EQ(
104 | algo::LCS(str1, str2),
105 | 4
106 | );
107 | }
108 | {
109 | std::string str1 = "abaaa";
110 | std::string str2 = "abababa";
111 | EXPECT_EQ(
112 | algo::LCS(str1, str2),
113 | 5
114 | );
115 | }
116 |
117 | }
118 | TEST(NQueenTest, FamousProblemsTest)
119 | {
120 | std::vector test{ 1, 0, 0, 2, 10, 4, 40, 92, 352, 724 };
121 | for (int i = 0; i < test.size(); i++)
122 | {
123 | EXPECT_EQ(algo::NQueenProblem(i + 1), test[i]);
124 | }
125 |
126 |
127 | }
128 |
129 |
--------------------------------------------------------------------------------
/AlgorithmTest/MathTest.cpp:
--------------------------------------------------------------------------------
1 | #include"pch.h"
2 |
3 | #include"Math/Math.h"
4 |
5 |
6 |
7 |
8 | TEST(BinPowMatrixMulTest, MathTest)
9 | {
10 |
11 | algo::Matrix mat{ {1, 1}, { 1, 0 } };
12 | algo::Matrix neutral{ {1, 0}, { 0, 1 } };
13 | algo::Matrix fib{ {1, 1} };
14 | mat = algo::bin_pow(mat, 7, neutral, algo::matrix_mul);
15 | fib = algo::matrix_mul(fib, mat);
16 | algo::Matrix etalon{ {34, 21} };
17 | EXPECT_EQ(fib, etalon);
18 | }
19 | TEST(EulerFunctionTest, MathTest)
20 | {
21 | for(int i = 2; i < 1000; ++i)
22 | EXPECT_EQ(algo::euler(i), algo::fast_euler(i));
23 | }
--------------------------------------------------------------------------------
/AlgorithmTest/SortingTest.cpp:
--------------------------------------------------------------------------------
1 | #include"pch.h"
2 |
3 | #include"Sortings/Sorting.h"
4 |
5 |
6 | TEST(SortingTest, SortingTest)
7 | {
8 | auto origin = getRandomVector(6, 0, 9);
9 | auto sorted_origin = origin;
10 | std::sort(sorted_origin.begin(), sorted_origin.end());
11 |
12 | {
13 | auto copy = origin;
14 | algo::BubbleSort(copy.begin(), copy.end());
15 | EXPECT_EQ(copy, sorted_origin);
16 | }
17 | {
18 | auto copy = origin;
19 | algo::SelectionSort(copy.begin(), copy.end());
20 | EXPECT_EQ(copy, sorted_origin);
21 | }
22 | {
23 | auto copy = origin;
24 | algo::InsertionSort(copy.begin(), copy.end());
25 | EXPECT_EQ(copy, sorted_origin);
26 | }
27 | {
28 | auto copy = origin;
29 | algo::RadixSort(copy.begin(), copy.end());
30 | EXPECT_EQ(copy, sorted_origin);
31 | }
32 | {
33 | auto copy = origin;
34 | algo::HeapSort(copy.begin(), copy.end());
35 | EXPECT_EQ(copy, sorted_origin);
36 | }
37 | {
38 | auto copy = origin;
39 | algo::MergeSort(copy.begin(), copy.end());
40 | EXPECT_EQ(copy, sorted_origin);
41 | }
42 | {
43 | auto copy = origin;
44 | algo::QuickSort(copy.begin(), copy.end());
45 | EXPECT_EQ(copy, sorted_origin);
46 | }
47 | }
--------------------------------------------------------------------------------
/AlgorithmTest/StringTest.cpp:
--------------------------------------------------------------------------------
1 | #include"pch.h"
2 |
3 | #include"Strings/StringHashing.h"
4 | #include"Strings/ZFunction.h"
5 | #include"Strings/PrefixFunction.h"
6 | #include
7 | #include
8 |
9 | TEST(HashingTest, StringTest)
10 | {
11 | {
12 | std::string test_string = "abacaba";
13 | std::string reverse_string = test_string;
14 | std::reverse(test_string.begin(), test_string.end());
15 | algo::StringHashing hash1(test_string);
16 | algo::StringHashing hash2(reverse_string);
17 | EXPECT_EQ(hash1.Get(), hash2.Get());
18 | EXPECT_EQ(hash1.Get(0, 2), hash2.Get(0, 2));
19 | EXPECT_EQ(hash1.Get(0, 2), hash2.Get(4, 6));
20 | EXPECT_EQ(hash1.Get(0, 2), hash1.Get(4, 6));
21 | EXPECT_EQ(hash1.Get(2, 4), hash2.Get(2, 4));
22 | EXPECT_EQ(hash1.Get(0, 0), 'a');
23 | EXPECT_EQ(hash1.Get(2, 2), 'a');
24 | EXPECT_EQ(hash1.Get(4, 4), 'a');
25 | EXPECT_EQ(hash1.Get(6, 6), 'a');
26 | }
27 | }
28 |
29 | TEST(PrefixFunctionTest, StringTest)
30 | {
31 | {
32 | algo::PrefixFunction p("abcabcd");
33 | std::vector etalon{ 0, 0, 0, 1, 2, 3, 0 };
34 | EXPECT_EQ(p.Get(), etalon);
35 | }
36 | {
37 | algo::PrefixFunction p("aabaaab");
38 | std::vector etalon{ 0, 1, 0, 1, 2, 2, 3 };
39 | EXPECT_EQ(p.Get(), etalon);
40 | }
41 | {
42 | algo::PrefixFunction p("abaabaabababaaabbbabababab");
43 | std::vector etalon{ 0, 0, 1, 1, 2, 3, 4,
44 | 5, 6, 2, 3, 2, 3, 4,
45 | 1, 2, 0, 0, 1, 2, 3,
46 | 2, 3, 2, 3, 2 };
47 | EXPECT_EQ(p.Get(), etalon);
48 | }
49 |
50 |
51 | }
52 |
53 | TEST(KnuthMorrisPrattTest, StringTest)
54 | {
55 | {
56 | algo::PrefixFunction p("abcabcd");
57 | std::vector etalon{ 0, 0, 0, 1, 2, 3, 0 };
58 | EXPECT_EQ(p.Get(), etalon);
59 | }
60 | {
61 | algo::PrefixFunction p("aabaaab");
62 | std::vector etalon{ 0, 1, 0, 1, 2, 2, 3 };
63 | EXPECT_EQ(p.Get(), etalon);
64 | }
65 | {
66 | algo::PrefixFunction p("abaabaabababaaabbbababababcd");
67 | std::vector etalon{ 0, 0, 1, 1, 2, 3, 4,
68 | 5, 6, 2, 3, 2, 3, 4,
69 | 1, 2, 0, 0, 1, 2, 3,
70 | 2, 3, 2, 3, 2, 0, 0 };
71 | EXPECT_EQ(p.Get(), etalon);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/AlgorithmTest/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/AlgorithmTest/pch.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // pch.cpp
3 | // Include the standard header and generate the precompiled header.
4 | //
5 |
6 | #include "pch.h"
7 |
8 | std::vector getRandomVector(int n, int min, int max)
9 | {
10 | std::vector random_vector(n);
11 | std::mt19937 rand_function(time(0));
12 | std::uniform_int_distribution uid(min, max);
13 | for (auto& elem : random_vector)
14 | {
15 | elem = uid(rand_function);
16 | }
17 | return random_vector;
18 | }
--------------------------------------------------------------------------------
/AlgorithmTest/pch.h:
--------------------------------------------------------------------------------
1 | //
2 | // pch.h
3 | // Header for standard system include files.
4 | //
5 |
6 | #pragma once
7 |
8 | #include "gtest/gtest.h"
9 | #include
10 | #include
11 | #include
12 |
13 | std::vector getRandomVector(int n, int min = -1000, int max = 1000);
14 |
15 |
--------------------------------------------------------------------------------
/AlgorithmTest/test.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 |
3 | TEST(SimpleTestCase, InitialTest) {
4 | EXPECT_EQ(1, 1);
5 | EXPECT_TRUE(true);
6 | }
--------------------------------------------------------------------------------
/Algorithms.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29613.14
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Algorithms", "Algorithms\Algorithms.vcxproj", "{8B2C733E-3D87-4AB4-9F08-2DF9102643D7}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06} = {CCB2C8E4-44A5-4731-9556-79CF4A514A06}
9 | EndProjectSection
10 | EndProject
11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CodePreprocessor", "CodePreprocessor\CodePreprocessor.vcxproj", "{CCB2C8E4-44A5-4731-9556-79CF4A514A06}"
12 | EndProject
13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlgorithmTest", "AlgorithmTest\AlgorithmTest.vcxproj", "{BBFFCC52-30D0-4E22-8E51-41245D12E1F1}"
14 | ProjectSection(ProjectDependencies) = postProject
15 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7} = {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}
16 | EndProjectSection
17 | EndProject
18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Coding", "Coding\Coding.vcxproj", "{4BB0180F-DDE9-4172-8518-58FDE5F49D2C}"
19 | ProjectSection(ProjectDependencies) = postProject
20 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7} = {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}
21 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06} = {CCB2C8E4-44A5-4731-9556-79CF4A514A06}
22 | EndProjectSection
23 | EndProject
24 | Global
25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
26 | Debug|x64 = Debug|x64
27 | Debug|x86 = Debug|x86
28 | Release|x64 = Release|x64
29 | Release|x86 = Release|x86
30 | EndGlobalSection
31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
32 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}.Debug|x64.ActiveCfg = Debug|x64
33 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}.Debug|x64.Build.0 = Debug|x64
34 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}.Debug|x86.ActiveCfg = Debug|Win32
35 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}.Debug|x86.Build.0 = Debug|Win32
36 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}.Release|x64.ActiveCfg = Release|x64
37 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}.Release|x64.Build.0 = Release|x64
38 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}.Release|x86.ActiveCfg = Release|Win32
39 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}.Release|x86.Build.0 = Release|Win32
40 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06}.Debug|x64.ActiveCfg = Debug|x64
41 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06}.Debug|x64.Build.0 = Debug|x64
42 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06}.Debug|x86.ActiveCfg = Debug|Win32
43 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06}.Debug|x86.Build.0 = Debug|Win32
44 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06}.Release|x64.ActiveCfg = Release|x64
45 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06}.Release|x64.Build.0 = Release|x64
46 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06}.Release|x86.ActiveCfg = Release|Win32
47 | {CCB2C8E4-44A5-4731-9556-79CF4A514A06}.Release|x86.Build.0 = Release|Win32
48 | {BBFFCC52-30D0-4E22-8E51-41245D12E1F1}.Debug|x64.ActiveCfg = Debug|x64
49 | {BBFFCC52-30D0-4E22-8E51-41245D12E1F1}.Debug|x64.Build.0 = Debug|x64
50 | {BBFFCC52-30D0-4E22-8E51-41245D12E1F1}.Debug|x86.ActiveCfg = Debug|Win32
51 | {BBFFCC52-30D0-4E22-8E51-41245D12E1F1}.Debug|x86.Build.0 = Debug|Win32
52 | {BBFFCC52-30D0-4E22-8E51-41245D12E1F1}.Release|x64.ActiveCfg = Release|x64
53 | {BBFFCC52-30D0-4E22-8E51-41245D12E1F1}.Release|x64.Build.0 = Release|x64
54 | {BBFFCC52-30D0-4E22-8E51-41245D12E1F1}.Release|x86.ActiveCfg = Release|Win32
55 | {BBFFCC52-30D0-4E22-8E51-41245D12E1F1}.Release|x86.Build.0 = Release|Win32
56 | {4BB0180F-DDE9-4172-8518-58FDE5F49D2C}.Debug|x64.ActiveCfg = Debug|x64
57 | {4BB0180F-DDE9-4172-8518-58FDE5F49D2C}.Debug|x64.Build.0 = Debug|x64
58 | {4BB0180F-DDE9-4172-8518-58FDE5F49D2C}.Debug|x86.ActiveCfg = Debug|Win32
59 | {4BB0180F-DDE9-4172-8518-58FDE5F49D2C}.Debug|x86.Build.0 = Debug|Win32
60 | {4BB0180F-DDE9-4172-8518-58FDE5F49D2C}.Release|x64.ActiveCfg = Release|x64
61 | {4BB0180F-DDE9-4172-8518-58FDE5F49D2C}.Release|x64.Build.0 = Release|x64
62 | {4BB0180F-DDE9-4172-8518-58FDE5F49D2C}.Release|x86.ActiveCfg = Release|Win32
63 | {4BB0180F-DDE9-4172-8518-58FDE5F49D2C}.Release|x86.Build.0 = Release|Win32
64 | EndGlobalSection
65 | GlobalSection(SolutionProperties) = preSolution
66 | HideSolutionNode = FALSE
67 | EndGlobalSection
68 | GlobalSection(ExtensibilityGlobals) = postSolution
69 | SolutionGuid = {A0DA8114-FBE4-4597-A8BD-1CE3034D4D47}
70 | EndGlobalSection
71 | EndGlobal
72 |
--------------------------------------------------------------------------------
/Algorithms/Algorithms.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 15.0
23 | {8B2C733E-3D87-4AB4-9F08-2DF9102643D7}
24 | Win32Proj
25 | Algorithms
26 | 10.0
27 |
28 |
29 |
30 | StaticLibrary
31 | true
32 | v142
33 | Unicode
34 |
35 |
36 | StaticLibrary
37 | false
38 | v142
39 | true
40 | Unicode
41 |
42 |
43 | StaticLibrary
44 | true
45 | v142
46 | Unicode
47 |
48 |
49 | StaticLibrary
50 | false
51 | v142
52 | true
53 | Unicode
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 | $(SolutionDir)$(Configuration)\;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86
76 |
77 |
78 | true
79 |
80 |
81 | false
82 | $(SolutionDir)$(Configuration)\;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86
83 |
84 |
85 | false
86 |
87 |
88 |
89 | Level3
90 | Disabled
91 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
92 | true
93 | ./include
94 | false
95 |
96 |
97 | true
98 | Console
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 | Level3
108 | Disabled
109 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
110 | true
111 | ./include
112 | false
113 |
114 |
115 | true
116 | Console
117 |
118 |
119 |
120 |
121 |
122 |
123 | lib /NOLOGO /OUT:"$(TargetPath).lib" "$(ProjectDir)/$(Configuration)*.obj"
124 |
125 |
126 |
127 |
128 | Level3
129 | MaxSpeed
130 | true
131 | true
132 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
133 | true
134 | ./include
135 | false
136 |
137 |
138 | true
139 | true
140 | true
141 | Console
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | Level3
151 | MaxSpeed
152 | true
153 | true
154 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
155 | true
156 | false
157 | ./include
158 |
159 |
160 | true
161 | true
162 | true
163 | Console
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
--------------------------------------------------------------------------------
/Algorithms/Algorithms.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 | {3ab02b56-21e7-4e57-b6e6-e0b5c50e1235}
18 |
19 |
20 | {b9bca163-90bc-4778-86af-ed7d6f16ee10}
21 |
22 |
23 | {2d803e43-0b94-49f5-9070-3f0233e02202}
24 |
25 |
26 | {a56662c6-f0fd-40ef-be10-f2f8276a61c4}
27 |
28 |
29 | {26bd53f2-f27e-4f28-8c12-8eb2895d5ee9}
30 |
31 |
32 | {e4694ef6-26a2-475b-befe-ccf2482c60b3}
33 |
34 |
35 | {3aada30b-67a2-469a-b866-cf6051875bdc}
36 |
37 |
38 | {28d2e31f-8a66-4db7-ae33-b46ac0a0ea1f}
39 |
40 |
41 | {212c4917-20db-4815-afa0-9a6027dee045}
42 |
43 |
44 | {00eb6170-afbd-4ac7-8481-b31e2e3fdbe1}
45 |
46 |
47 | {7ea4070e-cb4e-4b86-abc7-68314d48219b}
48 |
49 |
50 | {038c953c-6005-46ad-825c-4a515293a857}
51 |
52 |
53 | {1f5fa0f2-d9ec-4ffe-8f7a-a491e8ea67e7}
54 |
55 |
56 |
57 |
58 | Header Files\Utils
59 |
60 |
61 | Header Files\Utils
62 |
63 |
64 | Header Files\Utils
65 |
66 |
67 | Header Files\Graph
68 |
69 |
70 | Header Files\Graph
71 |
72 |
73 | Header Files\Graph
74 |
75 |
76 | Header Files\Graph
77 |
78 |
79 | Header Files\Geometry
80 |
81 |
82 | Header Files\Graph
83 |
84 |
85 | Header Files\Graph
86 |
87 |
88 | Header Files\Graph
89 |
90 |
91 | Header Files\Graph
92 |
93 |
94 | Header Files\Graph
95 |
96 |
97 | Header Files\Graph
98 |
99 |
100 | Header Files\Sortings
101 |
102 |
103 | Header Files\DataStructures
104 |
105 |
106 | Header Files\Graph
107 |
108 |
109 | Header Files\Graph
110 |
111 |
112 | Header Files\Graph
113 |
114 |
115 | Header Files\Graph
116 |
117 |
118 | Header Files\Graph
119 |
120 |
121 | Header Files\DataStructures
122 |
123 |
124 | Header Files\Graph
125 |
126 |
127 | Header Files\Graph
128 |
129 |
130 | Header Files\FamousProblems
131 |
132 |
133 | Header Files\DataStructures
134 |
135 |
136 | Header Files\Math
137 |
138 |
139 | Header Files\Strings
140 |
141 |
142 | Header Files\DataStructures
143 |
144 |
145 | Header Files\DataStructures
146 |
147 |
148 | Header Files\FamousProblems
149 |
150 |
151 | Header Files\Strings
152 |
153 |
154 | Header Files\Strings
155 |
156 |
157 | Header Files\Strings
158 |
159 |
160 | Header Files\DataStructures
161 |
162 |
163 |
164 |
165 | Resource Files\Geometry
166 |
167 |
168 | Resource Files\Graph
169 |
170 |
171 | Resource Files\Graph
172 |
173 |
174 | Resource Files\Graph
175 |
176 |
177 | Resource Files\Graph
178 |
179 |
180 | Resource Files\Graph
181 |
182 |
183 | Resource Files\Graph
184 |
185 |
186 | Resource Files\Graph
187 |
188 |
189 | Resource Files\Graph
190 |
191 |
192 | Resource Files\Graph
193 |
194 |
195 | Resource Files\Graph
196 |
197 |
198 | Resource Files\Graph
199 |
200 |
201 | Resource Files\Graph
202 |
203 |
204 | Resource Files\Graph
205 |
206 |
207 | Resource Files\Graph
208 |
209 |
210 | Resource Files\Graph
211 |
212 |
213 | Resource Files\DataStructures
214 |
215 |
216 | Resource Files\Graph
217 |
218 |
219 | Resource Files\Graph
220 |
221 |
222 | Resource Files\Strings
223 |
224 |
225 | Resource Files\Strings
226 |
227 |
228 | Resource Files\Strings
229 |
230 |
231 | Resource Files\Strings
232 |
233 |
234 | Header Files
235 |
236 |
237 |
--------------------------------------------------------------------------------
/Algorithms/Source_processed.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #pragma once
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include