Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Structures and data algorithms / Project / exb / CityVisit.h
diff options
context:
space:
mode:
Commitc79f7ea4ac93a9b11bff676d4174f5de46e0015b (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-12-29 17:43:27 +0200
Committer
 Syndamia <kamen@syndamia.com>
2022-12-29 17:43:27 +0200
Files6a283be740e4e2ea088bf0df6c986acc2a0cf9cb /Year 2/Structures and data algorithms/Project/exb/CityVisit.h
uni-projects-c79f7ea4ac93a9b11bff676d4174f5de46e0015b.tar
uni-projects-c79f7ea4ac93a9b11bff676d4174f5de46e0015b.tar.gz
uni-projects-c79f7ea4ac93a9b11bff676d4174f5de46e0015b.zip
Parent375d3979cef9a204591094b2c102036bbdd08efe (diff)
[SDP/P/exb] Solved exercise B
1 files changed, 30 insertions, 0 deletions
-rw-r--r--Year 2/Structures and data algorithms/Project/exb/CityVisit.h30
diff --git a/Year 2/Structures and data algorithms/Project/exb/CityVisit.h b/Year 2/Structures and data algorithms/Project/exb/CityVisit.h
new file mode 100644
index 0000000..c513542
--- /dev/null
+++ b/Year 2/Structures and data algorithms/Project/exb/CityVisit.h
@@ -0,0 +1,30 @@
+#ifndef CITY
+#define CITY
+
+#include <string>
+#include <deque>
+#include <utility> // използвам само pair
+#include <fstream>
+
+class CityVisit {
+ struct Landmark {
+ std::string name;
+ std::deque<std::pair<Landmark*, unsigned>> visitable;
+
+ Landmark(const std::string& name) : name(name), visitable() {}
+ };
+
+ std::deque<Landmark*> landmarks;
+ unsigned availableTime;
+
+ Landmark* find(const std::string& name);
+ void visitTheMostInTimeRec(Landmark* currentLandmark, std::deque<Landmark*> currPath, std::deque<Landmark*> unique, int timeLeft, std::deque<Landmark*>& bestPath, unsigned& uniqueCount);
+
+public:
+ void pushLandmarks(const std::string& from, const std::string& to, unsigned time);
+
+ void parse(std::ifstream& inFile);
+ std::deque<std::string> visitTheMostInTime(std::ifstream& inFile);
+};
+
+#endif