|
6 | 6 |
|
7 | 7 | namespace RodCutting |
8 | 8 | { |
9 | | - /// @brief Rod cutting algorithm to call recursively. |
10 | | - /// @param price prices for rod length |
11 | | - /// @param length length of a rod |
12 | | - /// @return the maximum revenue |
| 9 | + /** |
| 10 | + * \brief Rod cutting algorithm to call recursively. |
| 11 | + * \param price prices for rod length |
| 12 | + * \param length length of a rod |
| 13 | + * \return the maximum revenue |
| 14 | + */ |
13 | 15 | auto CutRod(const std::map<int, int>& price, int length) -> int; |
14 | 16 |
|
15 | | - /// @brief Rod cutting algorithm with memoization that use top-down approach. |
16 | | - /// @param price prices for rod length |
17 | | - /// @param length length of a rod |
18 | | - /// @return the maximum revenue |
| 17 | + /** |
| 18 | + * \brief Rod cutting algorithm with memoization that use top-down approach. |
| 19 | + * \param price prices for rod length |
| 20 | + * \param length length of a rod |
| 21 | + * \return the maximum revenue |
| 22 | + */ |
19 | 23 | auto MemoizedCutRod(const std::map<int, int>& price, int length) -> int; |
20 | 24 |
|
21 | | - /// @brief Sub procedure for rod cutting algorithm with memoization. |
22 | | - /// This use auxiliary array for memoization. |
23 | | - /// @param price prices for rod length |
24 | | - /// @param length length of a rod |
25 | | - /// @param memo memoized results |
26 | | - /// @return the maximum revenue |
| 25 | + /** |
| 26 | + * \brief Sub procedure for rod cutting algorithm with memoization. |
| 27 | + * This use auxiliary array for memoization. |
| 28 | + * \param price prices for rod length |
| 29 | + * \param length length of a rod |
| 30 | + * \param memo memoized results |
| 31 | + * \return the maximum revenue |
| 32 | + */ |
27 | 33 | auto MemoizedCutRodAux(const std::map<int, int>& price, int length, std::vector<int>& memo) -> int; |
28 | 34 |
|
29 | | - /// @brief Rod cutting algorithm that use bottom-up approach. |
30 | | - /// @param price prices for rod length |
31 | | - /// @param length length of a rod |
32 | | - /// @return the maximum revenue |
| 35 | + /** |
| 36 | + * \brief Rod cutting algorithm that use bottom-up approach. |
| 37 | + * \param price prices for rod length |
| 38 | + * \param length length of a rod |
| 39 | + * \return the maximum revenue |
| 40 | + */ |
33 | 41 | auto BottomUpCutRod(const std::map<int, int>& price, int length) -> int; |
34 | 42 |
|
35 | | - /// @brief Rod cutting algorithm that computes the maximum revenue and the optimal size of the first piece for given |
36 | | - /// rod length. |
37 | | - /// @param price prices for rod length |
38 | | - /// @param length length of a rod |
39 | | - /// @return the maximum revenue and the optimal size of the first piece |
| 43 | + /** |
| 44 | + * \brief Rod cutting algorithm that computes the maximum revenue and the optimal size of the first piece for given |
| 45 | + * rod length. |
| 46 | + * \param price prices for rod length |
| 47 | + * \param length length of a rod |
| 48 | + * \return the maximum revenue and the optimal size of the first piece |
| 49 | + */ |
40 | 50 | auto ExtendedBottomUpCutRod(const std::map<int, int>& price, int length) -> std::tuple<int, int>; |
41 | 51 | } |
42 | 52 |
|
|
0 commit comments