ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Subsequences.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*-------------------------- File Subsequences.h ---------------------------*/
3/*--------------------------------------------------------------------------*/
40/*--------------------------------------------------------------------------*/
41/*----------------------------- DEFINITIONS --------------------------------*/
42/*--------------------------------------------------------------------------*/
43
44#ifndef __ADS_Subsequences
45 #define __ADS_Subsequences
46/* self-identification: #endif constant */
47
48/*--------------------------------------------------------------------------*/
49/*------------------------------ INCLUDES ----------------------------------*/
50/*--------------------------------------------------------------------------*/
51
52#include "ADS/Contract.h"
53
54#include <algorithm>
55#include <cstddef>
56#include <vector>
57
58/*--------------------------------------------------------------------------*/
59/*--------------------------- NAMESPACE ------------------------------------*/
60/*--------------------------------------------------------------------------*/
61
62namespace ADS
63{
64
88template< class T >
89std::vector< T > lis( const std::vector< T > & A );
90
109template< class T >
110std::size_t lisLength( const std::vector< T > & A );
111
128template< class T >
129T maxSubarraySum( const std::vector< T > & A );
130
131/*--------------------------------------------------------------------------*/
132
133} // end( namespace ADS )
134
135/*--------------------------------------------------------------------------*/
136/*-------------------------- IMPLEMENTATION --------------------------------*/
137/*--------------------------------------------------------------------------*/
138
139#include "ADS/algorithm/impl/Subsequences.tpp"
140
141/*--------------------------------------------------------------------------*/
142
143#endif /* Subsequences.h included */
144
145/*--------------------------------------------------------------------------*/
146/*------------------------ End File Subsequences.h -------------------------*/
147/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::size_t lisLength(const std::vector< T > &A)
the length of a longest increasing subsequence,
std::vector< T > lis(const std::vector< T > &A)
a longest increasing subsequence,
T maxSubarraySum(const std::vector< T > &A)
the largest sum of a subvector, the empty one included,
Definition ADT.h:96