From b6a3bfe4691089112d25870fbb9bcc83c67f9d26 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 29 Dec 2022 08:57:29 +0200 Subject: [SDP/P/exa] Replaced parameter skiplists and stacks to deque --- Year 2/Structures and data algorithms/Project/exa/main.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Year 2/Structures and data algorithms/Project/exa/main.cpp') 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 visit; - visit.push("Plovdiv"); - visit.push("StaraZagora"); - visit.push("Yambol"); - visit.push("Burgas"); - std::stack path = cities.shortestSublistIncluding(visit); + std::deque locs = { "Plovdiv", "StaraZagora", "Yambol", "Burgas" }; + std::deque 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; } -- cgit v1.3.1-23-gd82d