/***********************************************************************
 * Problem
 * Function interface to implement
 ***********************************************************************/
#ifndef _PROBLEM_H_
#define _PROBLEM_H_

#include <stddef.h>
#include "Element.h"

/***********************************************************************
 * Returns the majority element of the given sequence if one such exists
 *
 * PARAMETERS
 * sequence       Valid pointer to an array of elements
 * sequenceLength Size of the array
 *
 * RETURN
 * element        A pointer to one element corresponding to the majority
 *                element or NULL if no such element exists
 ***********************************************************************/
const Element* getMajElDC(const Element* const * sequence, size_t sequenceLength);


/***********************************************************************
 * Computes the optimal partition of the given sequence
 *
 * PARAMETERS
 * sequence       Valid pointer to an array of elements
 * sequenceLength Size of the array
 * nbSubseq       Valid pointer to a writable size_t
 * indices        Address of a pointer to an array of indices
 *
 * RETURN-by-PARAMETERS
 * nbSubseq       The number of sub-sequences
 * indices        The indices of the first element of every subsequences
 *
 * RETURN
 * non-0          if error
 *
 * EXAMPLE
 * For the sequence ⟨i, c, g, h, b, c, d, e, f, e, f, d, b⟩, the optimal
 * partition is ⟨⟨i⟩,⟨c,g,h,b,c⟩,⟨d,e,f,e,f,d⟩,⟨b⟩⟩. Therefore,
 * *nbSubseq = 4
 *     and
 * *indices points to the array [0, 1, 6, 12]
 ***********************************************************************/
int getMinCutDP(const Element* const * sequence, size_t sequenceLength,
                size_t* nbSubseq, size_t** indices);



#endif // !_PROBLEM_H_
