From f5972aa2504009b105c589c5ea67e0eca6263425 Mon Sep 17 00:00:00 2001 From: Tishasoumya-02 Date: Sat, 18 Sep 2021 22:15:05 +0530 Subject: [PATCH] fix: try-catch block --- DIRECTORY.md | 1 + data_structures/reverse_a_linked_list.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 9f34cb25b..99a2767ae 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -123,6 +123,7 @@ * [Prim](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/graph/prim.cpp) * [Topological Sort](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/graph/topological_sort.cpp) * [Topological Sort By Kahns Algo](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/graph/topological_sort_by_kahns_algo.cpp) + * [Travelling Salesman Problem](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/graph/travelling_salesman_problem.cpp) ## Graphics * [Spirograph](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/graphics/spirograph.cpp) diff --git a/data_structures/reverse_a_linked_list.cpp b/data_structures/reverse_a_linked_list.cpp index 2e358fa4a..f9bd14095 100644 --- a/data_structures/reverse_a_linked_list.cpp +++ b/data_structures/reverse_a_linked_list.cpp @@ -1,10 +1,11 @@ /** * @file - * @brief Implementation of [Reversing + * @brief Implementation of [Reversing * a single linked list](https://simple.wikipedia.org/wiki/Linked_list) * @details * The linked list is a data structure used for holding a sequence of - * values, which can be added, displayed,reversed, or removed. + * values, which can be added, displayed, reversed, or removed. + * ### Algorithm * Values can be added by iterating to the end of a list (by following * the pointers) starting from the first link. Whichever link points to null @@ -17,8 +18,13 @@ * happens. And then we move the prev and current pointers one step forward. * Then the head node is made to point to the last node (prev pointer) after * completion of an iteration. +<<<<<<< HEAD * Graphic * Explanation:https://drive.google.com/file/d/1pM5COF0wx-wermnNy_svtyZquaCUP2xS/view?usp=sharing +======= + * [A graphic explanation and view of what's happening behind the + scenes](https://drive.google.com/file/d/1pM5COF0wx-wermnNy_svtyZquaCUP2xS/view?usp=sharing) +>>>>>>> 3635d1b7257e1909d9ee82b1ebecd83af8870d6e * */ #include /// for assert @@ -169,7 +175,7 @@ static void test() { // Reversal Testing assert(L.top() == 18); assert(L.last() == 11); - std::cout << "Passed" << std::endl; + std::cout << "All tests have successfully passed!" << std::endl; } /**