From 7baec9f9f9eb4f7916e7f9ec7533e02c058352c6 Mon Sep 17 00:00:00 2001 From: Panquesito7 Date: Mon, 6 Jul 2020 13:54:58 -0500 Subject: [PATCH] docs: minimax.cpp improvements --- backtracking/minimax.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backtracking/minimax.cpp b/backtracking/minimax.cpp index e52049477..9b97552da 100644 --- a/backtracking/minimax.cpp +++ b/backtracking/minimax.cpp @@ -1,13 +1,21 @@ /** * @file - * @brief brief one line description here + * @brief returns which is the longest/shortest number */ #include #include #include #include -int minimax(int depth, int node_index, bool is_max, std::vector scores, +/** + * Check which number is the maximum/minimum in the array + * @param depth depth of array + * @param node_index current index in array + * @param is_max if current index is the longest number + * @param scores saved numbers in vector + * @return if maximum or not + */ +int minimax(int depth, int node_index, bool is_max, std::vector* &scores, int height) { if (depth == height) { return scores[node_index];