Skip to content

Commit 28f6901

Browse files
committed
docs: documentation updated
1 parent 3f04892 commit 28f6901

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

greedy_algorithms/digit_separation.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
/**
22
* @file digit_separation.cpp
3-
* @brief This file contains the DigitSeparation class for separating digits of
4-
* large numbers.
5-
* https://www.log2base2.com/c-examples/loop/split-a-number-into-digits-in-c.html
6-
* @details
3+
* @brief Separates digits from numbers in forward and reverse order
4+
* @see https://www.log2base2.com/c-examples/loop/split-a-number-into-digits-in-c.html
5+
* @details The DigitSeparation class provides two methods to separate the
6+
* digits of large integers: digitSeparationReverseOrder and
7+
* digitSeparationForwardOrder. The digitSeparationReverseOrder method extracts
8+
* digits by repeatedly applying the modulus operation (% 10) to isolate the
9+
* last digit, then divides the number by 10 to remove it. This process
10+
* continues until the entire number is broken down into its digits, which are
11+
* stored in reverse order. If the number is zero, the method directly returns a
12+
* vector containing {0} to handle this edge case. Negative numbers are handled
13+
* by taking the absolute value, ensuring consistent behavior regardless of the
14+
* sign.
715
* @author [Muhammad Junaid Khalid](https://github.com/mjk22071998)
816
*/
917

0 commit comments

Comments
 (0)