mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-11-04 23:04:44 +08:00
fix: try-catch block
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 <cassert> /// 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user