#ifndef _VECTORSTUFF_H_
#define _VECTORSTUFF_H_

#include <vector>

using std::vector;

//  Prints the contents of vector a.
//  Nothing is printed if a is empty.
void print(const vector<int>& a);

//  Returns the maximum value in vector a.
//  The result is undefined if a is empty.
int max(const vector<int>& a);

//  Returns the minimum value in vector a.
//  The result is undefined if a is empty.
int min(const vector<int>& a);

//  Returns the number of even elements
//  in vector a.
//  Returns zero if a contains no even values.
int evens(const vector<int>& a);

//  Returns the position of the value seek
//  within vector a. 
//  Returns -1 (never a valid position in a
//  C++ vector) if seek is not an element of a.
int find(const vector<int>& a, int seek);

//  Returns the number of times the value seek
//  appears within vector a. 
//  Returns 0 if seek is not an element of a.
int count(const vector<int>& a, int seek);

//  Returns true if vectors a and b contain 
//  exactly the same elements in the same 
//  order; otherwise, the function returns false. 
bool equals(const vector<int>& a, const vector<int>& b);

//  Physically rearranges the elements of a
//  so they appear in order from lowest value
//  to highest value.
void sort(vector<int>& a);

//  Removes the first occurrence of element
//  seek from vector a.  (The first occurrence
//  has the lowest index.)
//  The vector is unaffected if seek is not an
//  element of a.
//  The function returns true if a element is
//  removed; otherwise, it returns false if
//  seek does not appear in a.
bool remove_first(vector<int>& a, int del);

//  Removes all occurrences of element
//  seek from vector a. 
//  The vector is unaffected if seek is not an
//  element of a.
//  The function returns the number of elements
//  removed; it returns zero if seek is not
//  found in the vector (and, therefore, nothing
//  can be removed).
int remove_all(vector<int>& a, int del);

//  If vector b is a continuous subsequence of vector a, the function 
//  returns the starting position within vector a at which 
//  vector b's values overlap.  If b is not a subsequence of
//  a, the function returns -1.  The empty vector 
//  is a subsequence of any sequence, and it begins at position
//  zero.
//  Returns the position of subsequence b within a.
int subsequence(const vector<int>& a, const vector<int>& b);

#endif
