From 8cd2e327ae7e5f4c65136a633e7843626972dce1 Mon Sep 17 00:00:00 2001 From: weiss-ben Date: Thu, 15 Sep 2022 20:34:03 +0300 Subject: [PATCH] Added @brief and wikipedia link to algo --- search/median_search2.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/search/median_search2.cpp b/search/median_search2.cpp index d0de62a36..2036a0923 100644 --- a/search/median_search2.cpp +++ b/search/median_search2.cpp @@ -1,9 +1,8 @@ /** * @file - * - * @details - * Given a linked list L[0,....,n] of n numbers, find the middle node. - * The technique utilized in this implementation is the "Floyd's tortise and hare" approach. Wikipedia link to technique: https://en.wikipedia.org/wiki/Cycle_detection#Floyd's_tortoise_and_hare + * @brief Given a linked list L[0,....,n] of n numbers, find the middle node. + * + * @details The technique utilized in this implementation is the "Floyd's tortise and hare" approach. Wikipedia link to technique: https://en.wikipedia.org/wiki/Cycle_detection#Floyd's_tortoise_and_hare * This technique uses two pointers that iterate through the list at different 'speeds' in order to solve problems. * In this implementation, for every iteration the slow pointer advances one node while the fast pointer advances two nodes. * The result of this is that since the fast pointer moves twice as fast as the slow pointer, when the fast pointer reaches the end of the list @@ -39,7 +38,7 @@ struct ListNode { namespace search { /** * @namespace median_search - * @brief Functions for the Median Search algorithm implementation. + * @brief Functions for the Median Search algorithm implementation. Wkipedia link to algorithm: https://en.wikipedia.org/wiki/Median_search */ namespace median_search2 { /**