diff options
[SDP/P/exa] Replaced parameter skiplists and stacks to deque
1 files changed, 4 insertions, 10 deletions
| -rw-r--r-- | Year 2/Structures and data algorithms/Project/exa/main.cpp | 14 |
diff --git a/Year 2/Structures and data algorithms/Project/exa/main.cpp b/Year 2/Structures and data algorithms/Project/exa/main.cpp index 1698a2c..88bf9ce 100644 --- a/Year 2/Structures and data algorithms/Project/exa/main.cpp +++ b/Year 2/Structures and data algorithms/Project/exa/main.cpp @@ -22,17 +22,11 @@ int main() { cities.print(std::cout) << std::endl; - SkipList<std::string> visit; - visit.push("Plovdiv"); - visit.push("StaraZagora"); - visit.push("Yambol"); - visit.push("Burgas"); - std::stack<std::string> path = cities.shortestSublistIncluding(visit); + std::deque<std::string> locs = { "Plovdiv", "StaraZagora", "Yambol", "Burgas" }; + std::deque<std::string> path = cities.shortestSublistIncluding(locs); - while (!path.empty()) { - std::cout << path.top() << ", "; - path.pop(); + for (auto loc : path) { + std::cout << loc << ", "; } std::cout << std::endl; - // path.print(std::cout) << std::endl; } |
