-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdutch_national_flag.h
43 lines (37 loc) · 1000 Bytes
/
dutch_national_flag.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef CPP_ALGORITHM_DUTCH_NATIONAL_FLAG_H
#define CPP_ALGORITHM_DUTCH_NATIONAL_FLAG_H
#include <vector>
namespace DutchFlag
{
/**
* \brief Color enum
*/
enum Color
{
Red,
White,
Blue
};
/**
* \brief Dutch national flag problem.
* \param pivot_index pivot index
* \param arr input array
* \return result array
*/
auto DutchFlagPartition1(int pivot_index, std::vector<Color>& arr) -> std::vector<Color>;
/**
* \brief Dutch national flag problem.
* \param pivot_index pivot index
* \param arr input array
* \return result array
*/
auto DutchFlagPartition2(int pivot_index, std::vector<Color>& arr) -> std::vector<Color>;
/**
* \brief Dutch national flag problem.
* \param pivot_index pivot index
* \param arr input array
* \return result array
*/
auto DutchFlagPartition3(int pivot_index, std::vector<Color>& arr) -> std::vector<Color>;
}
#endif